Hello everyone,
Just wanted to know that, is it possible to run two update queries in single select query??
Because, when ever I run the following code, only 1st update query is working fine.
//update gr_status as 1 if no pending gr found in purchase order data
$gr_query=mysql_query("SELECT * FROM purchase_order_data WHERE bal_status=0 AND po_no='".$po_no."'");
if(mysql_num_rows($gr_query)==0){
$gr_status=mysql_query
("UPDATE
purchase_order
SET
gr_status=1
WHERE
po_no='".$po_no."'");
$update_gr=mysql_query
("UPDATE
goods_received_note
SET
gr_status=1
WHERE
po_no='".$po_no."'");
}
yeh it is updating values as per first query,but it neither updates second field values nor it shows any error while running same queries directly to phpmyadmin
Oops… sorry about the italian (switching between languages sometimes I confuse things… you should see my collegues faces when I start talking Dutch )
*ducks and hides to avoid an excited Rudy *
I think you didn’t copy my code one on one. Can you post it here?
(Il suo duro per capire l’italiano se lei ha indossato lo sa. )
A perfect example of why not to use automatic translation services…
SELECT * FROM purchase_order_data WHERE bal_status=0 AND po_no='3'
UPDATE purchase_order SET gr_status=1 WHERE po_no='3'
UPDATE goods_received_note SET gr_status=1 WHERE po_no= '3'