how to create a table in mysql in php code.....in redhat

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
siddartha05
Forum Newbie
Posts: 1
Joined: Wed Jan 23, 2008 7:58 am
Contact:

how to create a table in mysql in php code.....in redhat

Post by siddartha05 »

its sayin syntax error................key missing.........can u help me
User avatar
webspider
Forum Commoner
Posts: 52
Joined: Sat Oct 27, 2007 3:29 am

Re: how to create a table in mysql in php code.....in redhat

Post by webspider »

what is your code?
User avatar
webspider
Forum Commoner
Posts: 52
Joined: Sat Oct 27, 2007 3:29 am

Re: how to create a table in mysql in php code.....in redhat

Post by webspider »

u can try something like that.....

Code: Select all

 
<?php
 
$sql = 'CREATE TABLE `product` (
        `pid` INT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT,
        `name` VARCHAR( 100 ) NOT NULL,
         PRIMARY KEY ( `pid` )
       )';
mysql_query( $sql);
?>
 
Post Reply