Copy link to clipboard
Copied
I have this code to retrieve user records:
$sql = "Select * from members
WHERE group = '$group'";
$sql_result = mysql_query($sql,$connection1)
or exit("Sql Error: " . mysql_error());
$sql_num = mysql_num_rows($sql_result);
i get the error:
Sql Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group = 1' at line 2
not sure what's wrong with that...
"group" is a reserved word in SQL. I'm suprised MySQL allows you to create a column with that name. You might be able to enclose it in quotes, but you really should change that column name.
Copy link to clipboard
Copied
"group" is a reserved word in SQL. I'm suprised MySQL allows you to create a column with that name. You might be able to enclose it in quotes, but you really should change that column name.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now