I am stuck with some code.
It's quite simple, I have the following code:
if ($somevariable == 1) {
echo 'Do Something here';
} else {
echo 'Do Something Else';
}
$somevariable is returning either 1 or nothing at all.
When the first condition is true ...when it's 1 it's working as it should ...
BUT the else condition does not return "Do Something Else" when nothing is return or it's empty.
Shouldn't ELSE mean any other condition?
How can I sort this problem out?
UPDATE
Actual Code:
$result2 = mysql_query("SELECT * FROM `follows` WHERE `user_id` = '$session_user_id' AND `venue_id` = '$venue_id'");
while ($row2 = mysql_fetch_assoc($result2))
{
$following = $row2['following'];
if ($following == 1) {
echo 'do something';
} else {
echo 'do something else';
}
}
Hope this helps