RE: [PHP-DB] Combining INSERT...SELECT and INSERT INTO
| From: | Beau Lebens | Date: | Thu, 17 Jan 2002 01:34:10 +0000 |
| Subject: | RE: [PHP-DB] Combining INSERT...SELECT and INSERT INTO | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-15900@lists.php.net to get a copy of this message | ||
if you are using mysql then no i don't think you can do that, since it
doesn't support nested queries - postgres or some other db may well support
it tho
but like miles said - give it a go :) (maybe on a test database/table just
in case)
hth
-b
// -----Original Message-----
// From: Markus Lervik [mailto:markus.lervik@vaasa.fi]
// Sent: Monday, 14 January 2002 6:54 PM
// To: php-db@lists.php.net
// Subject: [PHP-DB] Combining INSERT...SELECT and INSERT INTO
//
//
// Hello!
//
// It's me again, with the magazine database : )
//
// Is there any way to combine INSERT...SELECT and INSERT INTO so
// one could insert a new row with a few values inserted by
// hand and others
// from another table? something like
//
// INSERT INTO mag_table (mag_id,issn,year,info,volume,numbers,remarks)
// VALUES ( (SELECT id FROM mag_names WHERE mag_names.name="Asdf"),
//
"1234-5678","2001","foobar","1-4","1-52","foobar");
//
// I'm trying to construct myself a nice clever INSERT statement to my
// web-frontend. Haven't got it to work, though. Is this even possible?
// The other option would be to use three(?) mysql_query calls
// from my PHP-code,
// but I'd like to keep it as simple as possible.
//
// Cheers,
// Markus
//
// --
// Markus Lervik
// Linux-administrator with a kungfoo grip
// Vaasa City Library - Regional Library
// markus.lervik@vaasa.fi
// +358-6-325 3589 / +358-40-832 6709
//
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
// For additional commands, e-mail: php-db-help@lists.php.net
// To contact the list administrators, e-mail:
// php-list-admin@lists.php.net
//