I get this error message: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in ... on line 13.
Here's line 11 through 15:
//test for duplicate names
$query = "SELECT * FROM users WHERE username = $_POST["username"]";
$result = mysql_query($query);
$num = mysql_num_rows ($result);
I've double checked my database, and users database with username field exists.
I've tried to change $_POST["username"] into $_POST['username'], but it still gives me the same error message.
Could somebody help me to fix the error? Thanks
Here's line 11 through 15:
//test for duplicate names
$query = "SELECT * FROM users WHERE username = $_POST["username"]";
$result = mysql_query($query);
$num = mysql_num_rows ($result);
I've double checked my database, and users database with username field exists.
I've tried to change $_POST["username"] into $_POST['username'], but it still gives me the same error message.
Could somebody help me to fix the error? Thanks