hi
I need to query the database with 2 parameters from a URL :
http://mainevent.com/admin/galleries...d/1/type/venue
Code:
public function getGalleryByIdType($requestType="", $requestID="")
{
if($requestType ="event'){
$db = Zend_Registry::get('db');
$sql = $db->quoteInto("SELECT g.GalleryName, e.EventName
FROM Galleries g
LEFT JOIN EventGallery eg ON eg.GalleryID = g.GalleryID
LEFT JOIN Event e On e.EventID = eg.EventID
WHERE g.Type=? AND g.GalleryID=?" , $requestType,$requestID);
$query = $db->query($sql);
$results = $query->fetchAll();
return $results;
}
}
It seems the quoteInto function only accepts a single parameter. It returns an empty array with no results. And the function doesnt support supplying parameters as an array of values. I came across this article:
Modifying Zend_Db_Adapter_Abstract::quoteInto to accept multiple question marks at Amikelive | Technology Blog
And this guy recommends modifying the function definition. I just want to know if this is the appropriate route to solving this. Thanks