Fergus Gibson wrote:
On Fri, Sep 26, 2008 at 10:17 AM, muhsin <[EMAIL PROTECTED]> wrote:
Im stuck with this on my early scripts that im experimenting.These are the
echo of the SQL part:
INSERT INTO movietype (movietype_id, movietype_label) VALUE (1, 'Sci Fi'),
(2, 'Drama'), (3, 'Adventure'), (4, 'Comedy'), (5, 'Horror'), (6, 'Action'),
The "INSTERT" error has already been addressed. This statement has a
typo. MySQL has no idea what "INSTERT" means. The "Duplicate entry"
error is referring to the fact that you are attempting to add a
duplicate volume into a column that can contain only unique values.
The column in question is your primary key or has a UNIQUE index set
on it. If you run either query twice without clearing the data in the
table, this is the response you will get.
You could use an ENUM column in the people table to set the movie
types and do away with the movie table entirely.
You could use REPLACE instead of INSERT. REPLACE will act like INSERT
if there key isn't found, or it will replace the row if the key is
found. In many cases, you will be able to use AUTO_INCREMENT and
DEFAULT when constructing a table with a unique integer primary key
The documentation at mysql.com is your friend.
bingo thanks alot for spotting that, a life saver :-)
...i actually decided to go to sleep after that error.So now im fresh to
start again my mission.
Thanks for the tips, really appreciated guys
Hardware:x86-64 msi geforce 8600GT asus p5k-se