|
Posted by Jerry Stuckle on 08/28/07 00:15
Steve wrote:
>> You didn't show us your SELECT statement, but if it doesn't return any
>> rows, your mysql_fetch_array() call will return false - and not execute
>> anything in the loop.
>>
>>
>
> You're right, I didnt think of the array returning false.
>
> So how would i check for a value in the array, if the array returns false? Or
> how would I check for ANY results?
>
if mysql_fetch_array() returns false, there are no (more) rows to retrieve.
You can check mysql_num_rows() to see how many rows are returned. Or
you can try to fetch the first row - if it doesn't work, put out a
default. If it does work, go into a loop (ensure you fetch the next row
at the end of the loop - not the beginning!).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|