Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For the values, use the <code>'</code> character, not this one: ``` (sorry, I'll have to find out how to put a single backtick into an inline code block in Markdown...)</p> <pre><code>INSERT INTO `product`(`productid`, `title`, `category`, `description`) VALUES (NULL,'iMac','Desktop','With its enhanced, big and beautiful display, the new Apple iMac M-D093-B/A 21.5 Desktop Computer renders your movies, photos, web pages and other graphics in truly jaw-dropping detail.') </code></pre> <p>And this should work... <a href="http://sqlfiddle.com/#!2/93df3/1" rel="nofollow">Here is the SQLfiddle for it</a>.</p> <p><strong>EDIT</strong> This is the solution as per zour table definition:</p> <pre><code>INSERT INTO `product`(`title`, `category`, `description`) VALUES ('iMac','Desktop','With its enhanced, big and beautiful display, the new Apple iMac M-D093-B/A 21.5 Desktop Computer renders your movies, photos, web pages and other graphics in truly jaw-dropping detail.') </code></pre> <p>You had two things you forgot to mention: * <code>productid</code> is a <code>PRIMARY KEY</code> (and hence, automatically <code>NOT NULL</code>) column -- any inserts with a <code>NULL</code> in that column will fail * <code>productid</code> is an <code>AUTO_INCREMENT</code> column -- you don't even have to include it in the <code>INSERT</code> statement, it will get filled with an unique value each time you insert a row</p> <p><a href="http://sqlfiddle.com/#!2/08fc1/1" rel="nofollow">The SQL fiddle for this</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload