PHP Classes

File: install.php

Recommend this page to a friend!
  Classes of James Glenlake  >  SmashUser  >  install.php  >  Download  
File: install.php
Role: Configuration script
Content type: text/plain
Description: Creates database tables
Class: SmashUser
Database based user management with group support
Author: By
Last change:
Date: 18 years ago
Size: 766 bytes


Class file image Download

= parse_ini_file('config.ini.php', true);

$conn = mysql_connect($host, $username, $password) or die('Could not connect to server. Check your database details.');
mysql_select_db($db, $conn) or die('Could not select database.');
$uresult = mysql_query("create table ".$prefix."users (
                        username varchar(20) not null primary key,
                        password varchar(16) not null,
                        groupid varchar(20)
) or die('Could not create users table.');
'Users table created successfully.';
$gresult = mysql_query("create table ".$prefix."groups (
                        groupid varchar(20) not null primary key
) or die('Could not create groups table.');
'Groups table created successfully.';


For more information send a message to info at phpclasses dot org.