At Sunday, 5 August 2001, "olinux" <[EMAIL PROTECTED]> wrote:
>try this
>
>$result = mysql_query($sql_query);
>
>if ($result) {
> while ($row = mysql_fetch_array($result)) {
> $var_1 = $row['var_1'];
> $var_2 = $row['var_2'];
> }
>}
>
>olinux
This might work:
$result = mysql_query($sql_query);
$num_rows = mysql_num_rows($result);
if($num_rows > 0) {
*** code to execute if any rows were returned ***
} else {
*** code to execute if zero rows were returned ***
}
Hope this helps!
Cody
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]