I am trying to learn the best way to write queries. 我正在嘗試學習編寫查詢的最佳方法。 I also understand the importance of being consistent. 我也瞭解保持一致的重要性。 Until now, I have randomly used single quotes, double quotes, and backticks without any real thought. 到如今爲止,我在沒有任何實際考慮的狀況下隨機使用單引號,雙引號和反引號。 dom
Example: 例: ide
$query = 'INSERT INTO table (id, col1, col2) VALUES (NULL, val1, val2)';
Also, in the above example, consider that table
, col1
, val1
, etc. may be variables. 另外,在上面的示例中,請考慮table
, col1
, val1
等能夠是變量。 學習
What is the standard for this? 這是什麼標準? What do you do? 你是作什麼? this
I've been reading answers to similar questions on here for about 20 minutes, but it seems like there is no definitive answer to this question. 我已經在這裏閱讀了大約20分鐘的相似問題的答案,可是彷佛沒有確切的答案。 spa