Basically, on my localhost everything works fine. these are the php versions of both environments:
development (localhost) : 5.5.3
production: 5.3.27
I've been looking around quite some time to find a compatibility issue with no luck, this is kinda my last resort.
code snippet which returns the requested data in development but not in production:
function dbq($query, $array = array()) {
$core = Core::getInstance();
$STH = $core->dbh->prepare($query);
$sth = $STH->execute($array);
$res = $STH->fetchAll(PDO::FETCH_OBJ);
print_r($res);
}
the connection is established successfully before, so there are no issues there. As I've stated before '$res' returns empty arrays in production environment.
The function is called by other functions, an example of this is:
function first() {
return $this->dbq("SELECT * FROM $this->class
ORDER BY id ASC LIMIT 1");
}
note: the second parameter is used for prepared statements, and is not always necessary.