Hi, here's what I've got so far:

create table section ( section_id int(9) unsigned not null, section_name varchar(32), created datetime default '0000-00-00 00:00:00' not null, primary key (section_id) ); create table inventory_items ( item_id int(9) unsigned not null auto_increment, section_id int(9) unsigned, item_name varchar(32) not null, description varchar(255), photo_name varchar(255), created datetime default '0000-00-00 00:00:00' not null, modified datetime default '0000-00-00 00:00:00' not null, primary key (item_id), ); create table item_price ( item_id int(9) unsigned not null auto_increment, price decimal(11, 2), sale_price decimal(11, 2), valid_from datetime not null, valid_to datetime not null, primary key (item_id), );

I'm currently receiving an error "ERROR 1064 at line 8: You have an error in your SQL syntax near ')' at line 10." I'm running this from a file like so: mysql inventory < inventory.sql -u username -p I was receiving an error that said the same but at line 6 before, I removed the comma after primary key and it seemed to change the error - could this have something to do with whitespace/comma placement? I noticed in your example you placed the preceeding line's comma before the next statement.

Thanks! :)


In reply to Re: Re: Managing Inventory Sections with Perl and SQL by Anonymous Monk
in thread Managing Inventory Sections with Perl and SQL by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.