Issue
$map=$this->Sessiondetails->find("all");
$this->set("map",$map);
foreach($map as $maps){
echo $maps['Sessiondetails']['latitude'];
}
I want to fetch only 3rd row values . How to do it in cakephp. I am using cakephp 2x.
Solution
How would you do it in SQL? Think about it and then use cake syntax
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#retrieving-your-data
$map = $this->Sessiondetails->find(
"all"
array(
'offset' => 2
'limit' => 1
)
);
of course if you want to run a query that retrieves all the records but then just show the 3rd record you can simply do
echo $map[2]['Sessiondetails']['latitude']
Answered By - arilia Answer Checked By - Timothy Miller (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.