Jump to content

creating a table doesnt seem to work


jeff5656

Recommended Posts

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

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);


?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.