Concrete5 Form Block SQL Query, legal?
Permalink
Hello,
I'm confused why the loadSurveys() function ostensibly works correctly even though it references a column alias in the WHERE clause. This is in concrete/blocks/form/controller.php (around line #400 (i moved things around on my copy)).
Here is the query in question:
public static function loadSurveys($MiniSurvey){
$db = Loader::db();
return $db->query('SELECT s.* FROM '.$MiniSurvey->btTable.' AS s, Blocks AS b, BlockTypes AS bt '.
'WHERE s.bID=b.bID AND b.btID=bt.btID AND bt.btHandle="form" ' );
}
I'm trying to figure out why it works because I need to make some changes to it.
Thanks.
I'm confused why the loadSurveys() function ostensibly works correctly even though it references a column alias in the WHERE clause. This is in concrete/blocks/form/controller.php (around line #400 (i moved things around on my copy)).
Here is the query in question:
public static function loadSurveys($MiniSurvey){
$db = Loader::db();
return $db->query('SELECT s.* FROM '.$MiniSurvey->btTable.' AS s, Blocks AS b, BlockTypes AS bt '.
'WHERE s.bID=b.bID AND b.btID=bt.btID AND bt.btHandle="form" ' );
}
I'm trying to figure out why it works because I need to make some changes to it.
Thanks.