fxuser Posted February 1, 2011 Share Posted February 1, 2011 for example when i want to do a query to mysql i use mysql_query("INSERT INTO table VALUES('1','2','3')"); or mysql_query(SELECT * FROM table WHERE column1 = 'text'); do i have to put "`" in each table name and after the WHERE in the columns , also do i have to put after table (column1) , parentheses with their columns? i have seen it in some threads but im not sure what this will change on the performance of mysql? my website works just fine without these added so i would to know if i do have to add them or not. thanks. Quote Link to comment https://forums.phpfreaks.com/topic/226396-syntax-question/ Share on other sites More sharing options...
Maq Posted February 1, 2011 Share Posted February 1, 2011 do i have to put "`" in each table name and after the WHERE in the columns If your table is really named 'table' then yes, you have to use backticks around it every time since it is a MySQL RESERVED WORD. You should not be naming your tables OR columns with these words. If your table is named other than a reserved word then you don't need them, although, some consider it good practice. also do i have to put after table (column1) , parentheses with their columns? Take a look at the manual, it will answer this question: http://dev.mysql.com/doc/refman/5.5/en/insert.html Quote Link to comment https://forums.phpfreaks.com/topic/226396-syntax-question/#findComment-1168530 Share on other sites More sharing options...
fxuser Posted February 1, 2011 Author Share Posted February 1, 2011 it was just an example name. thanks Quote Link to comment https://forums.phpfreaks.com/topic/226396-syntax-question/#findComment-1168545 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.