RE: [PHP] creating mysql table

From: Date: Sun, 01 Oct 2000 01:36:56 +0000
Subject: RE: [PHP] creating mysql table
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-18183@lists.php.net to get a copy of this message
looks to me like you have an extra ')' after AUTO_INCREMENT ; > id INT PRIMARY KEY NOT NULL > AUTO_INCREMENT) > )"; Regards Andrew Braund > -----Original Message----- > From: bryan brown [mailto:donmon_98@yahoo.com] > Sent: Sunday, 1 October 2000 02:40 > To: php > Subject: [PHP] creating mysql table > > > I'm having trouble creating a table in Mysql. Can > someone please tell me whats wrong with this code. > > > <? > mysql_connect("localhost", "user", "password") or > die ("Unable to connect to database"); > $result = mysql_list_dbs(); > > while ($row = mysql_fetch_object($result)) { > echo $row->Database . "\n"; > } > > $query = "CREATE TABLE registration ( > first_name VARCHAR(30), > last_name VARCHAR(30), > email VARCHAR(50), > organization VARCHAR(50), > street VARCHAR(50), > city VARCHAR(30), > state VARCHAR(30), > zip INT(5) ZEROFILL, > country VARCHAR(50), > home_phone VARCHAR(14), > bus_phone VARCHAR(14), > how_found_aibo VARCHAR(30), > receive_info VARCHAR(3), > how_receive_info VARCHAR(30), > seen_aibo VARCHAR(3), > where_seen_aibo VARCHAR(30), > gender VARCHAR(1), > age INT(3), > occupation VARCHAR(30), > comp_preference VARCHAR(3), > id INT PRIMARY KEY NOT NULL > AUTO_INCREMENT) > )"; > > mysql_db_query("aibo", $query) or die ("Unable to > create registration table") ; > > ?> > > I get the following output: > > aibo binary_data brian ef_01 ef_02 itfirm jabb jabb1 > mambo mysql test users Unable to create registration > table > > Thanks >

« previous php.general (#18183) next »