<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
if($res)
{
$msg = getnick_uid($uid)."enter the room"; mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', userid='0', text='".$msg."'");
}
else
{
//just update the chonline list
}
dont remember if time sent is the correct field name anyways after doing that ....in the chat room when fetching the items from ibwf_chat
eg $sql = mysql_query("SELECT userid,timesent,text FROM ibwf_chat");
while($item = mysql_fetch_array($sql))
{
if($item[0]=='0')
{
$item[0]="chat_system";
echo $item[0].$item[1].$item[2];
}
else
{
//print the items
}</div>
i got some question here..
1. what u mean with //just update the chonline list
2. this is my add to chat..how to edit it?
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>function addtochat($uid, $rid)
{
$timeto = 120;
$timenw = time();
$timeout = $timenw - $timeto;
$exec = mysql_query("DELETE FROM ibwf_chonline WHERE lton<'".$timeout."'");
$res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
$res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
$res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
if(!$res)
{
mysql_query("UPDATE ibwf_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
}
}</div>
3. where must i put
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>dont remember if time sent is the correct field name anyways after doing that ....in the chat room when fetching the items from ibwf_chat
eg $sql = mysql_query("SELECT userid,timesent,text FROM ibwf_chat");
while($item = mysql_fetch_array($sql))
{
if($item[0]=='0')
{
$item[0]="chat_system";
echo $item[0].$item[1].$item[2];
}
else
{
//print the items
}</div>
hope somebody will answer me..
if($res)
{
$msg = getnick_uid($uid)."enter the room"; mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', userid='0', text='".$msg."'");
}
else
{
//just update the chonline list
}
dont remember if time sent is the correct field name anyways after doing that ....in the chat room when fetching the items from ibwf_chat
eg $sql = mysql_query("SELECT userid,timesent,text FROM ibwf_chat");
while($item = mysql_fetch_array($sql))
{
if($item[0]=='0')
{
$item[0]="chat_system";
echo $item[0].$item[1].$item[2];
}
else
{
//print the items
}</div>
i got some question here..
1. what u mean with //just update the chonline list
2. this is my add to chat..how to edit it?
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>function addtochat($uid, $rid)
{
$timeto = 120;
$timenw = time();
$timeout = $timenw - $timeto;
$exec = mysql_query("DELETE FROM ibwf_chonline WHERE lton<'".$timeout."'");
$res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
$res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
$res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
if(!$res)
{
mysql_query("UPDATE ibwf_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
}
}</div>
3. where must i put
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>dont remember if time sent is the correct field name anyways after doing that ....in the chat room when fetching the items from ibwf_chat
eg $sql = mysql_query("SELECT userid,timesent,text FROM ibwf_chat");
while($item = mysql_fetch_array($sql))
{
if($item[0]=='0')
{
$item[0]="chat_system";
echo $item[0].$item[1].$item[2];
}
else
{
//print the items
}</div>
hope somebody will answer me..

Comment