Creating a table
Posted: Sun Apr 22, 2007 3:22 pm
This for some reason doesn't work. I'm pretty sure I understand my PHP book. Is this not right? It doesn't create the table.
Code: Select all
<?php
include 'inc.php'; // This is the file that I have the DB username, password, etc in
mysql_connect($db['host'], $db['user'], $db['pass']);
mysql_select_db($db['db']);
$query = "CREATE TABLE members (
email VARCHAR(128) NOT NULL PRIMARY_KEY,
password VARCHAR(64) NOT NULL,
regdate VARCHAR(12) NOT NULL,
lastlogin VARCHAR(12),
country VARCHAR(3) NOT NULL,
lastip VARCHAR(50),
PRIMARY KEY(email) )";
mysql_query($query);
mysql_close();
?>