1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

avoid dublcate entering number

Discussion in 'Help and Support' started by abosirage, Dec 16, 2015.

  1. abosirage

    abosirage Member

    Joined:
    Jul 29, 2010
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Occupation:
    IT
    Location:
    Tripoli-Libya
    Hi brothers
    I need urgent help for my problem its about :
    I am using following code to avoid my user to inter number used before its work perfect always except last a few days I found duplicate number in my data base table
    part of code where process the number
    PHP:
    <?php
    $message 
    $idn;
    if (
    strlen($message) != 10){
       echo 
    "number must 10 digit";

    else 
    {
    if (!
    $name | !$add | !$colour | !$yea | !$country | !$branch | !$price
     
    | !$idn) {
    die(
    '<a href="everyuser.php?tag=">sorry idn lese than 10</a>');

    if (!
    get_magic_quotes_gpc()) {
    $idn addslashes($idn);
         }
     
    $usercheck $idn;
     
    $check mysql_query("SELECT idn FROM rescar WHERE idn = '$usercheck'"
     or die(
    mysql_error());
     
    $check2 mysql_num_rows($check);
     
     if (
    $check2 != 0) {
             die(
    ' sorry this number used before ( number &nbsp;&nbsp;'.$idn.'&nbsp;&nbsp;) ');
                     }
    ?> 
    could any one help and tell me what happened exactly and how to fix this problem .
    thank for your help
     

Share This Page