|
Posted by Gary L. Burnore on 02/01/06 00:23
On 31 Jan 2006 07:44:15 -0800, "Jeff" <joesiege@gmail.com> wrote:
>What's the best practice for handling the following situation, when I
>do an update like this:
>
>$sql = "UPDATE haha SET papa="loco" WHERE id=$var";
>$res = mysql_query($sql,$db);
>
>If I don't get a match in my where clause, i.e., 12!=44 the UPDATE does
>not occur but mysql_errno == 0 and mysql_error = "" so I can't capture
>the failure.
>
>Any thoughts?
Two. Do a select to count how many rows might need to be updated
before doing the update and remember that there's a
comp.databases.mysql group.
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
===========================================================================
[Back to original message]
|