Page 1 of 1

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

Posted: Wed Jan 23, 2008 8:22 am
by siddartha05
its sayin syntax error................key missing.........can u help me

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

Posted: Wed Jan 23, 2008 9:02 am
by webspider
what is your code?

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

Posted: Wed Jan 23, 2008 9:17 am
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);
?>