Phone number check

Discussion in 'MySQL' started by isuccess, May 25, 2008.

  1. #1
    Hi guys,

    I am trying to accomplish the following:

    1. Connect to the db and check to see if a phone number (not known to me) exists.
    2. If it does exist as input on the php form, I want the user to be forwarded to another page after clicking 'submit'
    3. If the number doesn't exist in the db, I want him to proceed with the process without interruption

    Basically what I am trying to do is check for a list of blocked phone numbers. If the numbers have been blocked by the user, I want the user to be forwarded elsewhere with a msg: "This number has been blocked from use..."

    DB name = blocked
    field = number

    How do I accomplish this? THANK YOU!
     
    isuccess, May 25, 2008 IP
  2. ForumJoiner

    ForumJoiner Active Member

    Messages:
    762
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    83
    #2
    Step 2 is before step 1? How do you get the number?

    If you want just the idea, you run a select ... where (`number` = $number). If the count (query) = 0, then the number is not in the database.

    If you want the full PHP / MySQL code, please reply.
     
    ForumJoiner, May 31, 2008 IP