Login   Register  
PHP Classes
elePHPant
Icontem

File: install.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2003-11-30 07:06
Size: 766 bytes
 

Contents

Class file image Download
<?php

$config 
parse_ini_file('config.ini.php'true);
extract($config);
extract($database);

$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.');
print 
'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.');
print 
'Groups table created successfully.';

?>