rocknbil - 5:32 pm on Jan 27, 2011 (gmt 0)
Right, you can do multiple inserts in one statement like your second example (almost) but not the first (I think.)
I tihnk I see the error. Are those quotes or backticks?
INSERT INTO 'model' ('manufacturer_id', 'model_name')
Backtick object references (tables, fields), quote values - but notable to mention, it's a "good habit" *not* to quote integer fields. The reason is, if you have this
insert into table (some_integer_field) values('$myid');
Which gives you
insert into table (some_integer_field) values('');
It will execute, but you will spend a lot of time trying to figure out why it's not inserting (this is one of the more common questions.) But if you do this for integer fields only,
insert into table (some_integer_field) values($myid);
It will give you
insert into table (some_integer_field) values();
Which will kick a mysql error, and alert you to the problem easier. This is especially true if you're parsing input form forms and somehow mistakenly do
$myid = 'Firstname';
Being text, mysql will always evaluate it to 0 when inserting into an integer field type.
Errors are not always bad, they can be useful tools.