I have a chatbox via the meta refresh tag which is included on every page. Thing is, it’s contributing to almost half of the loading time for loading a new page. Anyway to decrease this time by changing some codes (or the chat code itself)? I tried using Ajax but it still processed rather slowly.
chat history:
[php]<?php
include(‘config.php’);
$query = mysql_query(“SELECT * FROM chat
ORDER BY id
DESC LIMIT 20”);
while($row = mysql_fetch_assoc($query))
{
if($row[‘userID’] == 0) { $player = ‘Guest’; }
else
{
$player_q = mysql_query(“SELECT * FROM users
WHERE id
=’” . $row[‘userID’] . “’”);
$player_r = mysql_fetch_assoc($player_q);
$player = $player_r[‘callname’];
}echo ‘
}
?>
[/php]chat.php
[php]<?php
include(‘config.php’);
?>