RE: [PHP] creating mysql table From: Andrew Braund (abraund <email protected>)
Date: 09/30/00

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 <email protected>]
> 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
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>