hi people iv been posting this messaga long time but I did not get right answer what i need it i have table name to mysql, named (test) and example i have total 5 records when anyone submit 6 i wanna script automaticly remove old one and add new record
there is my code what i use but that script is missing:
<?
$table = "test";
require_once 'config.php';
MySQL_connect("$host","$login","$pass");
MySQL_select_db("$db") or die("Could not select database");
if (isset($_POST['submit'])) {
if (!$_POST['username'] | !$_POST['message']) {
die('You did not fill in a required field.');
}
$username = $_POST['username'];
$message = $_POST['message'];
}
$sql = "INSERT INTO $table SET username='$username',message='$message'";
$result = mysql_query($sql);
if ($result) {
echo "blla";
}
?>