Re: Create table .. script
| From: | Filip de Waard | Date: | Sat, 13 Mar 2004 17:18:34 +0000 |
| Subject: | Re: Create table .. script | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-180347@lists.php.net to get a copy of this message | ||
On Mar 13, 2004, at 5:24 PM, Mike Mapsnac wrote:
Hello When I need to create table I have to login into mysql and run the query. Is there a way to create some sort of scipt that can create all my tables?.So If I need create a table in new database I just run the script. I know that I can do mysql_query("QUERY OF TABLE"); But is there another way of doing this?$sql = "CREATE TABLE
rss_cat (
id int(11) NOT NULL auto_increment,
cat varchar(50) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM AUTO_INCREMENT=1";
mysql_query($sql);
Just use general SQL to create tables in PHP. This isn't the correct list for these kind of questions, since we have php-db for database related stuff.
Regards,
Filip de Waard