jeff5656 Posted December 17, 2008 Share Posted December 17, 2008 When I run this, I get a blank screen (no errors), but when I go into phpmyadmin the table is not there! Any ideas? <?php error_reporting(E_ALL); include ("connectdb.php"); $sql = "CREATE TABLE proc_list ( incr_id int(254) NOT NULL auto_increment, procedures varchar(20) NOT NULL PRIMARY KEY (`incr_id`) )"; // Execute query mysql_query($sql); ?> Link to comment https://forums.phpfreaks.com/topic/137407-creating-a-table-doesnt-seem-to-work/ Share on other sites More sharing options...
Mchl Posted December 17, 2008 Share Posted December 17, 2008 Display sql errors like this: mysql_query($sql) or die(mysql_error().": $sql"); INT(254) makes no sense. INTEGER will have no more than 11 diggits. Link to comment https://forums.phpfreaks.com/topic/137407-creating-a-table-doesnt-seem-to-work/#findComment-717986 Share on other sites More sharing options...
twm Posted December 17, 2008 Share Posted December 17, 2008 also missing a comma before PRIMARY. Try this: <?php error_reporting(E_ALL); include ("connectdb.php"); $sql = "CREATE TABLE proc_list ( incr_id int(11) NOT NULL auto_increment, procedures varchar(20) NOT NULL, PRIMARY KEY (incr_id) )"; // Execute query mysql_query($sql); ?> Link to comment https://forums.phpfreaks.com/topic/137407-creating-a-table-doesnt-seem-to-work/#findComment-717990 Share on other sites More sharing options...
jeff5656 Posted December 17, 2008 Author Share Posted December 17, 2008 Thank you. I got an error then saw the above post and now it works. Thanks to you both. (and changed to int 11) Link to comment https://forums.phpfreaks.com/topic/137407-creating-a-table-doesnt-seem-to-work/#findComment-717992 Share on other sites More sharing options...
Mchl Posted December 17, 2008 Share Posted December 17, 2008 Is there a ' after "procedures" ? There should not be. Link to comment https://forums.phpfreaks.com/topic/137407-creating-a-table-doesnt-seem-to-work/#findComment-717998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.