Now we need to design the database, I am providing a script that will create this table for you.
File: table.php
<?php
require 'db_connect.php';
// require above script
// change the path to match wherever you put it.
$table = "CREATE TABLE users (
id int(10) DEFAULT '0' NOT NULL auto_increment,
username varchar(40),
password varchar(50),
regdate varchar(20),
email varchar(100),
website varchar(150),
location varchar(150),
show_email int(2) DEFAULT '0',
last_login varchar(20),
PRIMARY KEY(id))";
$create = $db_object->query($table); //perform query
if(DB::isError($create)) {
die($create->getMessage());
} else {
echo 'Table created successfully.';
}
$db_object->disconnect();
?>
That script will create a table in the database you specified, once you have executed this script you can take it out of your document tree so others cannot run it.
You could also run the following database query in something like PHPMyAdmin:
CREATE TABLE users ( id int(10) DEFAULT '0' NOT NULL auto_increment, username varchar(40), password varchar(50), regdate varchar(20), email varchar(100), website varchar(150), location varchar(150), show_email int(2) DEFAULT '0', last_login varchar(20), PRIMARY KEY(id))
We will use this table to store user information, retrieve it and check it. Now we need to allow users to become members.
Continue to Sign Up »
In this tutorial: