Is there any reason NOT to wrap a long query over multiple line via new lines vs using concatenation?
For example, consider this:
$this->query("SELECT u.*, COALESCE(c2.name,u.state) AS real_state, c.name AS real_country, bc.alpha3 AS country_iso, bs.code AS state_iso
FROM " . MAIN_DB . ".users AS u
INNER JOIN " . MAIN_DB . ".countries AS c ON u.country=c.id
LEFT JOIN " . MAIN_DB . ".countries AS c2 ON u.state=c2.id
LEFT JOIN " . BLESTA_DB . ".countries AS bc ON c.country_iso_code=bc.alpha2
LEFT JOIN " . BLESTA_DB . ".states AS bs ON bc.alpha2=bs.country_alpha2 AND COALESCE(c2.name,u.state)=bs.name
WHERE u.active=1 AND u.mail_activated=1 AND u.blesta_id=0");
VS
$this->query("SELECT u.*, COALESCE(c2.name,u.state) AS real_state, c.name AS real_country, bc.alpha3 AS country_iso, bs.code AS state_iso " .
"FROM " . MAIN_DB . ".users AS u " .
"INNER JOIN " . MAIN_DB . ".countries AS c ON u.country=c.id " .
"LEFT JOIN " . MAIN_DB . ".countries AS c2 ON u.state=c2.id " .
"LEFT JOIN " . BLESTA_DB . ".countries AS bc ON c.country_iso_code=bc.alpha2 " .
"LEFT JOIN " . BLESTA_DB . ".states AS bs ON bc.alpha2=bs.country_alpha2 AND COALESCE(c2.name,u.state)=bs.name " .
"WHERE u.active=1 AND u.mail_activated=1 AND u.blesta_id=0");
Are there any possible problems with the first code or is either fine?