PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, April 22, 2022

[FIXED] how to store the database result in an array in cakephp?

 April 22, 2022     cakephp-2.3     No comments   

Issue

I fetched the result with query in cakephp in controller and save it in a variable when i echo the variable in view it display only "Array".No data is displayed so how to solve it?


Solution

Given:

$var = $this->Model->find('first', array('conditions'=>array('Model.id'=>$id)));

try using:

var_dump($var);

or

print_r($var);

or perhaps even better:

debug($var);

to see the result of your query.



Answered By - savedario
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing