SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Issue with Create Table statement

    I am not the MySQL guru so I used the dump command to get the syntax to re-create a table. When I ran the output I got a generic error and can't figure out why.

    Code:
    CREATE TABLE `purchase_orders` (
      `PO_ID` varchar(15) NOT NULL default '',
      `WorkOrderID` varchar(20) NOT NULL default '',
      `Vendor` varchar(50) NOT NULL default '',
      `Date_Created` date NOT NULL default '0000-00-00',
      `Requested_By` varchar(50) NOT NULL default '',
      `Description` longtext NOT NULL,
      `Quantity` int(11) NOT NULL default '0',
      `Net_Cost` decimal(10,2) NOT NULL default '0.00',
      `Net_Total` decimal(10,2) NOT NULL default '0.00',
      `Gross_Cost` decimal(10,2) NOT NULL default '0.00',
      `Gross_Total` decimal(10,2) NOT NULL default '0.00',
      `Active` tinyint(4) NOT NULL default '1',
      `DueDate` date default NULL,
      PRIMARY KEY  (`PO_ID`);
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  2. #2
    SitePoint Guru Marc's Avatar
    Join Date
    Nov 2000
    Location
    New York
    Posts
    765
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add another closing parenthesis before the final semicolon. So like this:
    PHP Code:
     CREATE TABLE `purchase_orders` (
       `
    PO_IDvarchar(15NOT NULL default '',
       `
    WorkOrderIDvarchar(20NOT NULL default '',
       `
    Vendorvarchar(50NOT NULL default '',
       `
    Date_Createddate NOT NULL default '0000-00-00',
       `
    Requested_Byvarchar(50NOT NULL default '',
       `
    Descriptionlongtext NOT NULL,
       `
    Quantityint(11NOT NULL default '0',
       `
    Net_Costdecimal(10,2NOT NULL default '0.00',
       `
    Net_Totaldecimal(10,2NOT NULL default '0.00',
       `
    Gross_Costdecimal(10,2NOT NULL default '0.00',
       `
    Gross_Totaldecimal(10,2NOT NULL default '0.00',
       `
    Activetinyint(4NOT NULL default '1',
       `
    DueDatedate default NULL,
       
    PRIMARY KEY  (`PO_ID`)
     ); 
    Marc Gugliuzza
    marc.gugliuzza.com



  3. #3
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank-you - that did the trick.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •