if ($sql_result = 0)
if you want to compare $sql_result with 0 you have to do it:
if ($sql_result == 0)
= is an assignment operator, == is a comparision operator
"Lmlweb" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm trying to get my code to print
Hi,
I've rewritten the code to:
// Sends the Query
$sql_result = mysql_query($sql);
if (!$sql_result) {
echo "Can't execute $sql " . mysql_error();
exit;
}
if (mysql_num_rows($sql_result) == 0) {
$option_block .= "Sorry, your search has resulted in 0 records. Please try
again. \n";
}
/
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
says...
> I'm trying to get my code to print out a "sorry - no results" message if
> there is no match. I've read the If statement in the PHP manual
> (http://www.php.net/manual/ro/control-structures.php#control-structures.if)
>
> and
>
> I thin
3 matches
Mail list logo