MySQL Forums
Forum List  »  Newbie

Re: Problem Updating
Posted by: Felix Geerinckx
Date: June 16, 2005 02:27AM

Rob page wrote:

> I can't figure out for the life of me why this won't work... but I am such a newb, ots crazy..

What errors do you get?


> $query1 = "UPDATE products SET prodname ='$prodname' WHERE prod_id = '$editid'";
> $query2 = "UPDATE products SET proddesc = '$proddesc' WHERE prod_id = '$editid'";
> $query3 = "UPDATE products SET prodsize = '$prodsize' WHERE prod_id = '$editid'";
> $query4 = "UPDATE products SET prodprice = '$prodprice' WHERE prod_id = '$editid'";
> $query5 = "UPDATE products SET prodcat = '$prodcat' WHERE prod_id = '$editid'";
> mysql_query($query1);
> mysql_query($query2);
> mysql_query($query3);
> mysql_query($query4);
> mysql_query($query5);

You don't want to do that in 5 queries if you can do it in 1:

UPDATE products SET prodname='$prodname', proddesc='$proddesc', etc..
WHERE prod_id = '$editid';

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
June 15, 2005 03:41PM
Re: Problem Updating
June 16, 2005 02:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.