$connect_status = "SELECT connected_to_id FROM tbl_connect WHERE user_id =
{$_SESSION['user_id']}";
$exec_connstatus_query = mysql_query($connect_status, $db_connect);
while($check_status = mysql_fetch_array($exec_connstatus_query))
{
if ($check_status['connected_to_id'] == $profileid)
{
echo "{$check_status['connected_to_id']}";
}
else
{
echo "fail";
}
}
This code has been troubling me for 3 hours. Here the issue is even if this condition:
if ($check_status['connected_to_id'] == $profileid)
returns false, I am not able to see "fail" when the else statement executes. Any ideas?
0or an empty string.$x ="$arr[a][b]"would normally fail because PHP's parser isn't gready and would only treat$arr[a]as an array, followed by a couple brackets and a b. using {} around the whole thing forces php to treat both bracket bits as part of the array dereference.