-- Alexander Netkachev <[EMAIL PROTECTED]> wrote
(on Monday, 05 March 2007, 07:40 PM +0200):
> On 3/5/07, Adam Balgach <[EMAIL PROTECTED]> wrote:
> The right ways is to use the following:
> $select=$this->_db->select();
> $select->from('table', array('firstname', 'lastname', 'email'));
> $select->where($this->_db->quoteInto('user_id = ?', $userId));

Actually, you don't need to use quoteInto:

    $select->where('user_id = ?', $userId);

will perform the quoting for you. :-)

Also, try out the fluent interfaces for prettier code:

    $select->from('table', array('firstname', 'lastname', 'email'))
           ->where('user_id = ?', $userId);

A little more readable.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to