I have a Table called users like that:
____ ____ __________ _____________
| | | | | | | |
| id | | name| |firstCon | | secondCon |
|____| |_____| |________ | |___________|
1 john true false
2 mark false false
I want to change the firstCon and secondCon values with true or false.
So I'm using the following query:
$sql = "UPDATE users SET ? = ? WHERE name = ?";
$query->bind_param($condition, $value, $name);
Where $condition is either firstCon or secondCon , $value = true/false , $name is the name of the user.
I get that error:
1064 You have an error in your SQL syntax;
check the manual that corresponds to your MariaDB server version
for the right syntax to use near '? = ? WHERE name = ?'
I'm using that method as I don't know which condition was selected , So I depend on the name.