Re: Re: create tables in mysql with php??

From: Date: Sun, 12 Aug 2001 02:25:03 +0000
Subject: Re: Re: create tables in mysql with php??
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-11257@lists.php.net to get a copy of this message
I am using this; mysql_query("create table ".$course_array[$i]." (CourseID char(8) not null, CourseTitle varchar(40), CourseTime varchar(255) not null)"); I echo the string inside the mysql_query() brackets, and I copy and pasted into: mysql>create table csc (CourseID char(8) not null, CourseTitle varchar(40), CourseTime varchar(255) not null); Query OK, 0 rows affected (0.05 sec) mysql> so putting it in manually works, but not from a query. Is there a silly syntactic error I am making? thanks, -Jon ----- Original Message ----- From: "CC Zona" <cczona@nospam.invalid> To: <php-db@lists.php.net> Sent: Saturday, August 11, 2001 9:55 PM Subject: [PHP-DB] Re: create tables in mysql with php?? > In article <001901c122d1$6f5c1720$0200a8c0@joncheng>, > joncheng2000@yahoo.com (Jon Cheng) wrote: > > > hello all, is there ANYWAY to create a new table in mysql with php? > > Sure. It's a query, you submit it just like any other. If you're getting > errors: > > (A) be sure the username in your mysql_connect() call has sufficient > privileges to create the table, > > (B) check with the MySQL manual to confirm that your "create" statement is > syntactically correct, and /or > > (C) call mysql_error() to find out what MySQL is choking on. > > -- > CC > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#11257) next »