I was wondering why some tutorials and other MySQL management tools use grave accent (`) in their queries like this one below:
SELECT `TableA`.`FieldA`, `TableA`.`FieldB`, `TableA`.`FieldC` FROM `Databasename`.`TableA`
When it displays the same result with this query below:
SELECT FieldA, FieldB, FieldC FROM TableA
Backticks are used in MySQL to select columns and tables from your MySQL source. In the example below we are calling to the table titled Album and the column Title . Using backticks we are signifying that those are the column and table names.
Backticks ( ` ) are used to indicate database, table, and column names. Unless you're using reserved or conflicting words for table and database names, you'll not need to use them.
The grave is more commonly referred to as a "backtick", which MySQL uses to escape MySQL reserved words.
Wrapping everything in backticks is very common in PHPMyAdmin and various examples because most would rather name tables and columns whatever they like without worrying about naming errors. I don't agree with the practice personally...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With