Using backticks around field names

前端 未结 11 1332
-上瘾入骨i
-上瘾入骨i 2020-11-22 02:05

After reading a couple of answers and comments on some SQL questions here, and also hearing that a friend of mine works at a place which has a policy which bans them, I\'m w

11条回答
  •  無奈伤痛
    2020-11-22 02:28

    Simple Thing about backtick `` is use for denote identifier like database_name, table_name etc, and single quote '', double quote "" for string literals, whereas "" use for print value as it is and '' print the value variable hold or in another case print the text his have.

    i.e 1.-> use `model`;   
        here `model` is database name not conflict with reserve keyword 'model'
    2- $age = 27;
    insert into `tbl_people`(`name`,`age`,`address`) values ('Ashoka','$age',"Delhi");
    
    here i used both quote for all type of requirement. If anything not clear let me know..
    

提交回复
热议问题