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 -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -