-- debussy007 <[EMAIL PROTECTED]> wrote
(on Monday, 02 June 2008, 03:46 AM -0700):
> In my query string I have '?' characters which I want to replace by
> parameters:
> 
> $sql = 
>       'SELECT COUNT(*) FROM contact_detail D, girls G, partners P ' .
>       'WHERE D.girl_id = G.id_girl ' .
>               'AND D.member_confirmed = 1 ' .
>               'AND G.partner_id = ? ' .
>               'AND D.isRead = ?';
> $this->view->notReadContacts = $db->fetchOne($sql,
> array($auth->getIdentity()->id_partner, 0));
> 
> 
> The problem is that when I use the profiler, I get the following query:
> 
> Executed SELECT COUNT(*) FROM contact_detail D, girls G, partners P WHERE
> D.girl_id = G.id_girl AND D.member_confirmed = 1 AND G.partner_id = ? AND
> D.isRead = ?
> 
> The parameters are not replaced.

The profiler will not show the replacements, as the replacements are
performed by the database server (the implementation uses prepared
statements). You can retrieve the query parameters that were used by
calling the getQueryParams() method of the given query profile.

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to