Posted by friglob on 09/26/06 10:09
monomaniac21 wrote:
> Hi all!
>
> How can you get rid of the error that displays if you do a query which
> returns no result and then try and fetch the array, WITHOUT having to
> put the while in another conditional like if ($result != ''), something
> more efficient if possible.
>
> regards
>
> Marc
>
$result = mysql_query($query);
$num = mysql_num_rows($result);
if( $num ) {
while ($row = mysql_fetch_array($result)){
//whatever
}
}
Navigation:
[Reply to this message]
|