Am Mon, 2001-12-31 um 16.39 schrieb Thomas Sourmail:

> INSERT INTO papers(title, journal_id, author_id, whatever) 
> values ('The title',
> select journal_id from journal where name='The journal',
> select author_id from author where name='The author',
> etc..);

in theory this will work, but not with mysql. mysql does not support
(yet) subselects (those in the brackets). you can do single selects for
journal_id and author_id, save them in some variables and put together
the final insert statement with those variables. i guess you use php. do
something like:

$insert_papers=
"INSERT INTO papers(title, journal_id, author_id, whatever)
values ('The Title',".$jounal_id.",".$author_id.",whatever)";

now use $insert_papers for you mysql select.

btw, there are better mailing lists for both mysql and php... ;)

have fun,
Tobias

-- 

"Many that live deserve death. And some that die deserve life.
Can you give it to them? Then do not be too eager to deal out death in
judgement.
For even the very wise cannot see all ends."

- Gandalf


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to