Results 1 to 2 of 2

Thread: Restricting on table data entry...

  1. #1
    Join Date
    Feb 2009
    Posts
    156
    Thanks
    0
    Thanked 4 Times in 3 Posts

    Default Restricting on table data entry...

    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.

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    PHP Code:
    <?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];
    ?>
    Last edited by james438; 11-16-2009 at 05:21 AM.
    To choose the lesser of two evils is still to choose evil. My personal site

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •