racamiles - 2014-01-27 12:33:18
In the Query() method the type of query is checked by following code:
if ( strpos(strtolower($sql), "insert") === 0){...}
else if ( strpos(strtolower($sql), "select") === 0 ){...}
For readability reasons I build my query like this:
$Sql = "
SELECT
SUM(Amount) AS Payment
FROM $Table
WHERE Ic = \"$Ic\"
AND ( PayedOn BETWEEN \"$DateFrom\" AND \"$DateTo\")
";
Naturally, the query type check fails because of the whitespaces in front of the SELECT keyword. I would suggest to TRIM the $sql in the Query() method.