Mysql uses backticks ( ` ) for quoting the table and column names in SQL queries.
Mysql can use either ' or " for quoting strings inside SQL queries.
So to update name with Joe you could end up with a PHP string, which contains a legitimate SQL string which looks like:
$sql = "update `my_table` set `name` = 'Joe' where id = 34";
But equally this would be allowed:
$sql = "update my_table set name = 'Joe' where id = 34";
The backticks are not necessary unless you name your table or one of your columns using one of the Mysql reserved words.
So if you had to update a table containing a column called
before you MUST backtick ( ` ) quote it because before is on that list.
$sql = "update my_table set `before` = '2012-02-01' where id = 34";
A couple of other things to note in those examples:
Date and time fields must be quoted like strings.
Number fields in your database such as an auto-increment id field do NOT need quoting
You could reverse the single and double quoting and it would still work
Short version: backticks are for mysql sql statements. Single/double quotes must deliminate strings in both PHP and Mysql so you must carefully respect your use of them.