Re: [PHP-DB] multiple queries in the same request

2005-06-20 Thread Bruno Ferreira
Gabriel B. wrote: SELECT (@category_id:=id) FROM categories WHERE description = cat1; REPLACE INTO data VALUES( 10, @category_id); i send this as a single query in PHP and it returns an error quoting everything after the first ; anyidea if i can't send several queries at once? any workaround?

Re: [PHP-DB] multiple queries in the same request

2005-06-20 Thread Bruno Ferreira
Gabriel B. wrote: You can't send multiple queries in an SQL statement. You can just split that in two separates queries. It's not really slower by any I'm not really concerned about performance. i'm *really* concerned about race conditions. I have more than 3mi hits per day. the

RE: [PHP-DB] multiple queries, one transaction - REWORDED

2005-05-22 Thread Frank Flynn
FROM purchaseItems WHERE orderID = '789' and itemIDs = whatever Good Luck, Frank On May 20, 2005, at 5:02 PM, [EMAIL PROTECTED] wrote: From: mayo [EMAIL PROTECTED] Date: May 20, 2005 4:45:05 PM PDT To: 'Miguel Guirao' [EMAIL PROTECTED], php- [EMAIL PROTECTED] Subject: RE: [PHP-DB] multiple

Re: [PHP-DB] multiple queries, one transaction - REWORDED

2005-05-22 Thread Andrés G . Montañez
Crate an Array, where the Key is the ItemId, and the value is the ItemQty. If the client want to delete an the item, unset the key, if the client wont to add or remove an item quantity, just change the value. Then when the items and quantities are correct, just start transaction begin foreach If

RE: [PHP-DB] multiple queries, one transaction - REWORDED

2005-05-20 Thread mayo
-Original Message- From: Miguel Guirao [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 17, 2005 7:41 PM To: mayo; php-db@lists.php.net Subject: RE: [PHP-DB] multiple queries, one transaction There is a function that gets the last auto increment value for an ID field!! -Original Message- From

RE: [PHP-DB] multiple queries, one transaction

2005-05-17 Thread mayo
1:30 PM To: 'mayo' Subject: RE: [PHP-DB] multiple queries, one transaction You could always use $orderId = mysql_insert_id($result) to pull the autoinc id that was created from your insert statement... But I think your question revolves more around how do I do a query then how do I pull the id

RE: [PHP-DB] multiple queries, one transaction

2005-05-17 Thread mayo
-db@lists.php.net Subject: RE: [PHP-DB] multiple queries, one transaction Thanks, the $orderId = mysql_insert_id($result) was what I was looking for. But in the long run, I'm still concerned about how to group several queries into one transaction. As for example when one wants to make multiple

RE: [PHP-DB] multiple queries, one transaction

2005-05-17 Thread Miguel Guirao
There is a function that gets the last auto increment value for an ID field!! -Original Message- From: mayo [mailto:[EMAIL PROTECTED] Sent: Martes, 17 de Mayo de 2005 10:27 a.m. To: php-db@lists.php.net Subject: [PHP-DB] multiple queries, one transaction I would like to get the itemID

Re: [PHP-DB] multiple queries

2003-12-02 Thread Gary Every
Or do the same with the BETWEEN keyword: SELECT * FROM dates WHERE store='$store' AND date BETWEEN DATE_SUB(now(), interval 3 day) AND DATE_ADD(now(), interval 3 day) Richard Davey wrote: Hello Cameron, Tuesday, December 2, 2003, 1:08:19 AM, you wrote: CS $sql = SELECT * from dates where

Re: [PHP-DB] multiple queries

2003-12-01 Thread Richard Davey
Hello Cameron, Tuesday, December 2, 2003, 1:08:19 AM, you wrote: CS $sql = SELECT * from dates where store=$store and date=$date; CS ultimately I would like to display data for 3 days on either side of CS this. The following is un-tested, but a quick look over the MySQL manual should firm

Re: [PHP-DB] multiple queries with PHP

2003-09-05 Thread John W. Holmes
John Ryan wrote: I want to SELECT * from a table and also update the hit counter by 1. So theres 2 different queries which I know I can easily do in PHP seperately, but I thought itd be quicker and more efficient to run them in the same query, ie seperated by a ';'. But PHP returns an error, and

Re: [PHP-DB] multiple queries with PHP

2003-09-05 Thread John Ryan
You wouldnt know where to change this setting? John W. Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] John Ryan wrote: I want to SELECT * from a table and also update the hit counter by 1. So theres 2 different queries which I know I can easily do in PHP seperately, but

Re: [PHP-DB] multiple queries with PHP

2003-09-05 Thread John W. Holmes
John Ryan wrote: You wouldnt know where to change this setting? It's not a setting, you just can't do it. Use two mysql_query() calls. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP

Re: [PHP-DB] multiple queries in PHP to mysql database.

2003-03-28 Thread Ronan Chilvers
Hi Jerry Inline comments On 28 Mar,2003 at 12:31 JeRRy JeRRy wrote: How can I update 2 tables at once if a match occours from information inputed into a PHP form. How about turning this around and re-organising the data a little? Why not have a single score table with references to

Re: [PHP-DB] multiple queries in a rov

2002-07-02 Thread Martin Clifford
Load the query into a variable, usually $query. $query = SELECT * FROM table; SELECT * FROM othertable;; $result = mysql_query($query, $link_id) or die(error msg); Mattia [EMAIL PROTECTED] 06/27/02 02:19PM I would like to make multiple queries in a single mysql_query(...) statement!! Like

Re: [PHP-DB] multiple queries in a row

2002-07-02 Thread Casey Allen Shobe
On Thursday 27 June 2002 02:19 pm, Mattia wrote: I would like to make multiple queries in a single mysql_query(...) statement!! Like in the mysql client given with the distribution, separated by a ; or a \g !!! How can I??? You should be able to use it exactly the same. $foo = mysql_query('

Re: [PHP-DB] multiple queries in a row

2002-07-02 Thread Jason Wong
On Wednesday 03 July 2002 04:36, Casey Allen Shobe wrote: On Thursday 27 June 2002 02:19 pm, Mattia wrote: I would like to make multiple queries in a single mysql_query(...) statement!! Like in the mysql client given with the distribution, separated by a ; or a \g !!! How can I??? You

Re: [PHP-DB] multiple queries in one php statement....

2001-07-19 Thread Ryan Fischer
Could someone give me a tip ang tell me if i can insert more than one queries in a mysql_query() statement?? etc $quer=mysql_query(" BEGIN WORK , QUERY 1 , QUERY 2, COMMIT",$db) No, you can't. You've got to execute them one at a time. -- -Ryan :: ICQ - 595003 :: GigaBoard -

Re: [PHP-DB] multiple queries in one php statement....

2001-07-19 Thread leo g. divinagracia iii
cant... since the function returns a code if the call is true or not. if you try multiple statements, you cant know which failed and which was good... Koutsogiannopoulos Karolos wrote: Hello everyone... Could someone give me a tip ang tell me if i can insert more than one queries in a