Hello friends! I ask for help, I can not update the next hour and minute all'username when I'm in the chat room. when you refresh the page, you also update the timetables of other messages, ie, a message written ten minutes ago .. update it with the current time. I'm trying to figure out what is wrong. I created this table
put this file chat.php
dopo fatto questo codice
e questo
e poi questo
but I do not understand why the messages are not updated! Maybe it takes a function in file core.php?
Thanks to those who know help me
PHP Code:
CREATE TABLE `ibwf_chat` (
`id` int(99) NOT NULL auto_increment,
`chatter` int(100) NOT NULL default '0',
`who` int(100) NOT NULL default '0',
`timesent` int(50) NOT NULL default '0',
`msgtext` varchar(255) NOT NULL default '',
`data` varchar(5) NOT NULL default '',
`rid` int(99) NOT NULL default '0',
`exposed` char(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
PHP Code:
include("config.php");
include("core.php");
connectdb();
$action=$_GET["action"];
$id=$_GET["id"];
$sid = $_GET["sid"];
$rid=$_GET["rid"];
$rpw=$_GET["rpw"];
$uid = getuid_sid($sid);
$uexist = isuser($uid);
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
$data = date("H:i");
PHP Code:
$chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".time()."', data='".time()."', msgtext='".$message."', rid='".$rid."';");
$lstmsg = mysql_query("UPDATE ibwf_rooms SET lastmsg='".time()."' WHERE id='".$rid."'");
PHP Code:
$chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='1', who='', timesent='".time()."', data='".time()."', msgtext='".$reply." @".getnick_uid($uid)."', rid='".$rid."';");
}
$message = "";
}
echo "<br/>";
$chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed,data FROM ibwf_chat WHERE rid='".$rid."' ORDER BY timesent DESC, id DESC");
$counter=0;
PHP Code:
echo $data."<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a>:<br> ";
echo $tosay."<br/>";
PHP Code:
///////////////////clear data function cleardata(){ $timeto = 100; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM ibwf_chonline WHERE lton<'".$timeout."'"); $timeto = 300; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM ibwf_chat WHERE timesent<'".$timeout."'"); $timeto = 60*60; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM ibwf_search WHERE stime<'".$timeout."'");
Comment