All pastes #193091 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-10-06 15:38 UTC
rendered paste body
 #search the database for duplicate names
    //$result = mysql_query("SELECT COUNT(*) FROM users WHERE username = ' ".$_POST['uname']." ' LIMIT 1");
    $result = mysql_query("SELECT * FROM users WHERE username = ' ".$_POST['uname']." ' ") or die('Error Connecting to Database');
    $check = mysql_num_rows($result);

    if($check !== "0")
    {
    	die('Sorry, the username: <strong>'.$_POST['uname'].'</strong> is already taken, please pick another one.');
    } //end of if statement