php - F3 return query result -


i try build rest interface using fat free framework. use following code query database:

$product = new db\sql\mapper($this->db, 'product'); $product->load(array('id=?', $this->productid)); 

i can return instance title with

echo json_encode($product->title); 

but how return whole row? following won't work

echo json_encode($product); 

found it. had use

echo json_encode($product->cast()); 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -