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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -