okie ... this is for a chat room im working on and the problem is the private messaging .. ok it works tho
i use this for user selection .. whom to send a private message too
<select name=\"who\">";
$sql = "SELECT username FROM online where room='$id' and username!='$uid' ORDER BY username ";
$result = mysql_query($sql);
if (!$result) {
error('A database error occurred in processing your '.
'submission.\\nIf this error persists, please '.
'myemail@hotmail.com');
}
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$username=mysql_result($result,$i,"username");
echo"
<option value=\"$username\">$username</option> ";
++$i;
}
echo"
</select>
and posting that form ...
if no users are online appart from urself if shows up blank (thats what i want) but ...
the next page .. the chat display page i use
$who=$_POST['who'];
being the username
and before the private message being inserted to the database have the following
if ($who==' '){
}
but it goes ahead and does it anyway ... can anyone help please ?