The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Search engine...but what kind exactly?

Discussion in 'Database Discussions' started by shelzee, Feb 10, 2008.

  1. shelzee

    shelzee Registered

    Joined:
    Nov 22, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Being new to this world I still struggle with the language. Can someone tell me what it is I'm looking for? Please!
    It's a type of search engine very similar to the one used by hotmail (or any email provider) when you select your name (eg: michelle@hotmail.com) and it shows you that it has already been used and that you must choose something else. Where would I find something like this?
    Any help is greatly appreciated.
    CHEEEERS!!!!
     
  2. shelzee

    shelzee Registered

    Joined:
    Nov 22, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    wow this is a great forum!
     
  3. rejected

    rejected Well-Known Member

    Joined:
    Sep 19, 2006
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    0
    This is greta forum when askign for help with cPanel related issues ;)

    What you want is somehitng what will check user input against a database if the row count is equal to 1 say its taken otherwise insert.. eg:


    <?php
    mysql_connect();
    mysql_select_db();
    if(isset($_POST['u'], $_POST['p'])) {
    $u = mysql_real_escape_string($_POST['u']);
    $q = mysql_query("SELECT username FROM users WHERE username = '$u'");
    if(mysql_num_rows($q) >= 1) {
    echo "Username taken";
    }
    else {
    // Process form data....
    }

    }
    ?>

    Just a example of where you would go with it in no way do i mean use this as it will not work without the SQL backend ect..
     
Loading...

Share This Page