Claus,
There is something you can do. Add a field to the table that contains the entries of the chat. Call this field 'id'.
Add this to the PHP script taht enters the entries into the database:
We'll just assume that id will be the fourth field in the table.
<?PHP
$paco = "select * from tablename";
$ocap = mysql_query($paco);
$i = 0
while ($row=mysql_fetch_array($ocap)) {
if ($row[3] > $i) {
$i = $row[3];
}
}
$i = $i++;
?>
Now, in your insert statement, add one more field, $i - that is the new ID number.
Last but not least, after the insert statement, we'll need to add this script:
Again, we are assuming that the ID tag is the fourth field inthe table
<?PHP
$green = "select * from tablename";
$jello = mysql_query($green);
$dragnet = mysql_numrows($jello);
$deletable = $dragnet - 30;
while ($myrow=mysql_fetch_array($jello)) {
if ($deletable != 0) {
$remove = "delete from tablename where id like $deletable";
$please = mysql_wuery($remove);
$deletable = $deletable - 1;
}
}
$johny = "select * from tablename";
$rotten = mysql_query($johnny);
/ This will reset the ID count to 1 through 30. /
$j = 1;
while ($rowrow=mysql_fetch_array($rotten)) {
$joy = "update tablename set id=$j where id like $rowrow[3]";
$hate = mysql_query($joy);
$j = $j++;
}
?>
That's it man - hope this works out for you - let me know how it goes
-=Lazzerous=-