|
Posted by Rik Wasmus on 11/09/07 18:07
On Fri, 09 Nov 2007 18:52:30 +0100, Big Moxy <bigmoxy@gmail.com> wrote:
> On Nov 9, 9:38 am, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>> On Fri, 09 Nov 2007 18:25:36 +0100, Big Moxy <bigm...@gmail.com> wrot=
e:
>> > $rows =3D mysql_num_rows($result) or die(mysql_error());
>>
>> How do you think this well act if the result of mysql_num_rows() is 0=
?
>
> I want mysql_num_rows() =3D 0 to be treated as a not found condition.
> Isn't that already handled?
0 converted to boolean is false, so your code die()'s. There is no actua=
l =
mysql error, so the die(mysql_error()) will die without any message. =
Remove the 'or die' clause, you already handle a 0 result in your if =
statement further on, and a faulty result with your 'or die' following t=
he =
mysql_query().
-- =
Rik Wasmus
[Back to original message]
|