21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 881 Views |
-
SQL table modified outside CMS

5 April 2010 at 8:38am
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.
-
Re: SQL table modified outside CMS

5 April 2010 at 10:07am
Try this:
$sqlQuery->from = array("TradingHours");
| 881 Views | ||
|
Page:
1
|
Go to Top |


