faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

33 of 58 people (57%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How do I create a table in MySQL from within a php script?
mysql_query("CREATE TABLE" works with MySQL3.22.26a, but not with MySQL 3.22.32 . Why?

Jul 21st, 2000 13:37
Ferdinando Simonetti, Matt Gregory, Kerry-Lynn Sorrell,


//once you are connected to your database:
mysql_query("CREATE TABLE Blah (Hoopy VARCHAR(30), Frood VARCHAR(10) 
NOT NULL)");
//Simply replace the tablename and field names with those of the table 
you wish to create.
Yes, but i tried this code with php-3.0.15 & MySQL 3.22.26a (works 
perfectly) and php-3.0.15 & MySQL 3.22.32 (don't work at all).
I've got exactly the same results when i tried:
mysql_query("GRANT SELECT ON pippo.pluto TO minnie@localhost, 
IDENTIFIED BY 'goofy'").
My question was "why? anyone can give me a reason for that?".
Same OS & platform (Linux RedHat/Intel)
Thanks