Hello,
I've got some outside modifed tables in database, and not need to modify that tables in CMS, but need to print out data in templates. So i'm stuck in creating queries for that tables. I use simple SS like query:
return DataObject::get("tradinghours");
And got and error:
[User Error] Bad class to singleton() - tradinghours
if(!class_exists($className)) user_error("Bad class to singleton() - $className", E_USER_ERROR);
When trying to more complicated way fom sqlquery example:
$sqlQuery = new SQLQuery();
$sqlQuery->select = array('Name', 'Opening', 'Closing');
$sqlQuery->from = "TradingHours";
//$sqlQuery->where = "";
//$rawSQL = $sqlQuery->sql();
$result = $sqlQuery->execute();
I've stuck into an error:
[Warning] implode() [function.implode]: Invalid arguments passed
$text .= " FROM " . implode(" ", $sqlQuery->from);
Need assistance to figure out. Thank you.