17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1254 Views |
-
show query result

25 November 2008 at 5:06am
Hi!
I have a big problem with my query. Can you hel me to show the result?
I create a function in Page.php that contain my query and that return $result. then I copy $result uin my template but nothig happen. what is wrong?
This is my code:function TakeValue(){
$sqlQuery = new SQLQuery();
$sqlQuery->select[] = array(
'nome AS nome',
'tipologia AS tipologia'
);
$sqlQuery->from[] = "
RicercaPollSubmission
";
$sqlQuery->where = "
Tipologia(RicercaPollSubmission.tipologia) = 1
";
// get the raw SQL
$rawSQL = $sqlQuery->sql();
// execute and return a Query-object
$result = $sqlQuery->execute();
//turn it into SilverStripe objects
$result = new DataObjectSet();
foreach($query as $row) {
$result->push(new TakeValueDataObject($row));}
return $result;
}
| 1254 Views | ||
|
Page:
1
|
Go to Top |

