Answer the question
In order to leave comments, you need to log in
Why by coding style (php) concatenation in SQL?
Why use string concatenation in SQL? framework.zend.com/manual/1.12/en/coding-standard....
Example from the document above:
$sql = "SELECT `id`, `name` FROM `people` "
. "WHERE `name` = 'Susan' "
. "ORDER BY `name` ASC ";
$sql = "SELECT `id`, `name` FROM `people`
WHERE `name` = 'Susan'
ORDER BY `name` ASC ";
Answer the question
In order to leave comments, you need to log in
You misunderstood a little, there are key points:
Well, it can be convenient for various reasons, for example, write comments or comment out some line:
$sql = "SELECT `id`, `name` FROM `people` "
. "WHERE `name` = 'Susan' "
// закомментировано на время отладки
// . "ORDER BY `name` ASC "
. "ORDER BY `name` DESC LIMIT 5"
;
ну как же, на сервер идет в несколько байт меньше данных)
аля всякие \t и \n...
+ некоторые IDE сами переносят код
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question