mysql - Trying to select from database specific column value using php -


i have database want value from. have website i'm allowing user create new username based on first name, last name, selected username, , password. have working except checking duplicate usernames. have tried following code returns 500 error.

    $usernamequery = mysqli_query("select * users username = $username");         if(!empty($usernamequery){             $usernameerror = "username exists, try again";             $dontsubmit = true;         } 

i've been racking brain on couple of days now. appreciated. :)

try this, have missed close bracket in ) if condition

if(!empty($usernamequery)){ 

instead of

if(!empty($usernamequery){ 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -