I'm trying to delete a specific column value from an SQL table with php. The table looks like this:
my_db
------------------------------------------
code | user | email |
------------------------------------------
10314343 | 20 | [email protected] |
13423434 | 22 | [email protected] |
11342434 | 40 | [email protected] |
What I want to do is update the "code" value to empty on user "20". Here is what I have so far but it's not working:
$tbl_name = mydb;
$getcode = "10314343"
$updateCode = "UPDATE $tbl_name SET code ='', where code ='$getcode'";
$confirmUpdate = mysql_query($updateCode);
mysql_*functions. use MySQLi or PDO instead. Here is a good tutorial for PDO.,beforewhere