Hi, i'm trying to understand the differences between the find($id) method and the fetchRow("id = $id") method.
When I try to use find, i get that i don't get any row, but when i use fetchRow I do.
Please could something explain me a little about this?
Here I paste something of my controller action:
With find (it seems that i don't get the row)
PHP Code:
$id = $this->_getParam('id');
$imagen = new Image();
$imagenData = $imagen->find($id);
if ($imagenData) {
$this->view->imagen = $imagenData;
$this->view->error = 0;
} else {
$this->view->error = 1;
$this->view->mensaje = "La imagen pedida ya no existe";
}
And with fetchRow (it works really fine):
PHP Code:
$id = $this->_getParam('id');
$imagen = new Image();
$imagenData = $imagen->fetchRow("id = $id");
if ($imagenData) {
$this->view->imagen = $imagenData;
$this->view->error = 0;
} else {
$this->view->error = 1;
$this->view->mensaje = "La imagen pedida ya no existe";
}