I'm a designer, but as there's no programmer in my company I have to start studing programming. Which I did only somedays ago (and I have only a html and css knowledge background) so pleasepleaseplease don't take any knowledge for granted if you can answer me!
I'm studing PHP and MySQL using "PHP & MySQL in easy steps" by Mike McGranth (if any of you have it I'm at page 90/91). So, the task is simple: write a .sql file and create a table in phpMyAdmin with it.
Since it's an exercise from a book I just have to write as it's written on the page and test it; yes, I have the solution-file too, but the point is I can't see the difference between my code, which can't be processed by phpMyAdmin, and the solution-code, which gives no problem.
The .sql file written by me is this:
CREATE TABLE IF NOT EXISTS products
(
id INT UNIQUE AUTO_INCREMENT ,
code INT NOT_NULL ,
name VARCHAR(25) NOT NULL ,
quantity INT DEFAULT 1 NULL ,
price DECIMAL(6,2) NOT NULL
) ;
And the solution-file code is this:
CREATE TABLE IF NOT EXISTS products
(
id INT UNIQUE AUTO_INCREMENT ,
code INT NOT NULL ,
name VARCHAR(25) NOT NULL ,
quantity INT DEFAULT 1 NULL ,
price DECIMAL(6,2) NOT NULL
) ;
This is also how the look like in a code-editor program:
This is the error that phpMyAdmin gives to me (if the japanese part is important I can add the translation):
Since I have a solution, why do I ask? Because maybe I've done just a small mistake, but if I don't understand it I'm afraid to do it again when handling bigger files, maybe a client db, real work, not just an exercise. So, if anyone will be so kind to explain it to me he/she will have my ethernal gratitude!