Topic: PHP while loop problem
This is being used for an IRC client..
while (true)
{
$query = mysql_query("SELECT * FROM rows WHERE session_id='".$config['session_id']."'") or die(mysql_error());
if (mysql_num_rows($query)) {
while ($row = mysql_fetch_assoc($query)) {
cmd_send(prep_text($row['message'], $row['channel']));
}
}
mysql_query("DELETE FROM rows WHERE session_id='".$config['session_id']."'");
echo "blah\n";$con['buffer']['all'] = trim(fgets($con['socket'], 4096));
echo $con['buffer']['all']."\n";
if(substr($con['buffer']['all'], 0, 6) == 'PING :') {
cmd_send('PONG :'.substr($con['buffer']['all'], 6));} elseif ($old_buffer != $con['buffer']['all']) {
// make sense of the buffer
parse_buffer();
}
if (feof($con['socket']))
break;
$old_buffer = $con['buffer']['all'];
}
It SHOULD echo blah constantly, as it is in the while loop, but it doesn't. Instead, it only echo's "blah" when the socket receives data.
I've tried to figure this out for a while now, and I can't. It just makes no sense to me...
So, if someone could please help me, I would highly appreciate it
$theQuestion = (2*b) || !(2*b);