Re: Multiple SQL queries?
| From: | (Richard Lynch) | Date: | Fri, 16 Jun 2000 01:01:50 +0000 |
| Subject: | Re: Multiple SQL queries? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2020@lists.php.net to get a copy of this message | ||
In article <01932F2B7E20D211856C00A0C9A060955640E1@HIS03>,
l.mergen@HumanInference.com (Leon Mergen) wrote:
> Is it possible to execute multiple SQL queries within on mysql_query("blah
> blah blah"); ?
>
> For example:
>
> $r=mysql_query("insert into one values ('yes'); insert into two values
> ('no');");
>
> Is this possible?
No.
You can maybe make "Stored Procdures" (MySQL, Oracle, Sybase?) or
"functions" (PostgreSQL, ???) in your database that execute multiple
queries as a unit, but they're not real portable.
The fact that you're asking means you may simply have designed your
database not-so-well... No offense. Give some thought about how you
could re-structure your tables instead:
Actually, for an insert, you might be able to do something like this:
insert into both (name, yesno) values('one', 'yes') ('two',
'no')
I'm sure I got the SQL wrong, but there's a way to do multiple inserts in
one query...
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)