Jump to content

creating a table in a database


BrentonHale

Recommended Posts

mysql> CREATE TABLE order_contents (
    -> oc_id INT(10) UNSIGNED NOT NULL
    -> AUTO_INCREMENT,
    -> order_id INT(10) UNSIGNED NOT NULL,
    -> print_id INT(4) UNSIGNED NOT NULL,
    -> quantity TINYINT UNSIGNED NOT NULL,
    -> DEFAULT 1,
    -> price decimal(6,2) NOT NULL,
    -> ship_date DATETIME default NULL,
    -> PRIMARY KEY (oc_id),
    -> KEY order_id (order_id),
    -> KEY print_id (print_id),
    -> KEY ship_date (ship_date)
    -> ) ENGINE=InnoDB;

 

 

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near 'DEFA

LT 1,

price decimal(6,2) NOT NULL,

ship_date DATETIME default NULL,

PRIMARY' at line 7

mysql>

 

 

What does all of these errors mean?  I'm using the following MySQL Version 5.1.36  .  The code looks correct unless the syntax has changed since version 4.1 .  If it has, can someone give me the updated code to use.

 

Link to comment
https://forums.phpfreaks.com/topic/187500-creating-a-table-in-a-database/
Share on other sites

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.