View Full Version : Restricting on table data entry...
gurmeet
03-08-2009, 10:59 AM
Hi friends... I want to know that, is there any way to restrict the records? Means a user name ABC can enter only 5 records when he or she enters 6th record, 1st record automatically deleted from the table.... Plz help me by giving ur valueable ideas....thanx.
james438
11-16-2009, 05:11 AM
<?php
$conn = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $conn);
$result = mysql_query("SELECT summary, ID FROM memoblog WHERE summary='ABC' ORDER BY ID desc", $conn);
$num_rows = mysql_num_rows($result);
while ($list_info = mysql_fetch_array($result)) {
$id[]=$list_info['id'];
}
if ($num_rows>=5) $new_entry_id=$id[0];
?>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.