J
John S
Guest
I can't figure why when my array is equal to 0 it still echos yes when it should say no.
$result = mysql_query("SELECT COUNT(*) FROM title WHERE title LIKE '%blue%'");
$array = mysql_fetch_array($result);
echo $array[0];
if ($array = 0) {
echo "yes";
}
else {
echo "no!";
}
Doing what peng says will always give me the else and never the if
$result = mysql_query("SELECT COUNT(*) FROM title WHERE title LIKE '%blue%'");
$array = mysql_fetch_array($result);
echo $array[0];
if ($array = 0) {
echo "yes";
}
else {
echo "no!";
}
Doing what peng says will always give me the else and never the if