ispCP - Board - Support
Coding style - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: General discussion (/forum-11.html)
+--- Thread: Coding style (/thread-4234.html)



Coding style - momo - 09-11-2008 12:47 AM

I have noticed that most sql query are done like this, whitch is pretty easy to read :

$query = <<<SQL_QUERY
SELECT
alias_id, alias_name
FROM

According to ispCP documentation, shouldn't it be :
http://www.isp-control.net/documentation/dev/php_coding_style

$sql = "SELECT `id`, `name` FROM `people` "
. "WHERE `name` = 'Susan' "
. "ORDER BY `name` ASC ";

(dot aligned with equal sign)


Thank you


RE: Coding style - sci2tech - 09-11-2008 01:06 AM

This is inherited from VHCS. In time all heredoc notation will be replaced.


RE: Coding style - momo - 09-11-2008 01:13 AM

sci2tech Wrote:This is inherited from VHCS. In time all heredoc notation will be replaced.

Not sure I get it.
Is the documentation wrong or <<<SQLQUERY wrong ? (or my understanding Rolleyes Smile )


RE: Coding style - sci2tech - 09-11-2008 01:15 AM

momo Wrote:<<<SQLQUERY wrong ?
Yes "<<<SQLQUERY" is wrong". This type of notations is called HEREDOC.


RE: Coding style - momo - 09-11-2008 01:23 AM

Cool Thk a lot