Re: mysql_error on an update
>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.
It's NOT a failure. The query did what you wanted it to.
>From an application point of view, sometimes affecting or
retrieving any rows is a failure (consider black lists).
I believe you can look at mysql_affected_rows() and see how many
rows it changed.
Gordon L. Burditt
.
Relevant Pages
- Re: getting back is as hard as getting there?
... > In practice, though, unless they're in their own reentry capsulewithin ... failure modes but you could ... > huge advantage in practice if you usually get the vehicle back. ... (sci.space.policy) - Re: Problems in a commercial flight
... if the purpose of the practice is to experience a loss of meaningful power and to execute the proper diagnostics to the engine as well as the correct emergency procedures? ... Surely an engineer would anticipate the failure of a computer system. ... Why would an engineer ignore this time-tested approach to wing design in favor of an active system? ... (rec.aviation.piloting) - Re: Tempering bolts
... Go buy the tool that does proper double flares, and redo it the ... Think of the first attempt as either "Practice" or a ... huge difference in the likely consequences of a failure. ... Even if it's "only" the clutch ... (rec.crafts.metalworking) - Re: Dont know nearly as much....
... old practice. ... I think the failure of the Constitutional ... "The real question of government versus private enterprise is argued on ... (rec.arts.sf.fandom) - Re: Dont know nearly as much....
... carry the load, is just a slightly exaggerated continuation of an ... old practice. ... I think the failure of the Constitutional ... (rec.arts.sf.fandom) |
|