RE: [PEAR-DEV] Using tokens to build where clause in autoExecute
| From: | Lukas Smith | Date: | Mon, 05 May 2003 13:28:53 +0000 |
| Subject: | RE: [PEAR-DEV] Using tokens to build where clause in autoExecute | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-15884@lists.php.net to get a copy of this message | ||
> From: Mads Mohr Christensen [mailto:mohr@lusker.dk]
> Sent: Monday, May 05, 2003 3:00 PM
> This makes this update possible:
>
> $table_name = 'mytable';
>
> $fields_values = array(
> 'textfield' => 'whee'
> );
>
> $id = 1;
>
> $result = $db->autoExecute($table_name, $fields_values,
> DB_AUTOQUERY_UPDATE,
> 'id = ?', $id);
>
> or
>
> $result = $db->autoExecute($table_name, $fields_values,
> DB_AUTOQUERY_UPDATE,
> 'id = ? AND textfield = ?', array($id, 'spam'));
>
> Is this something worth adding or should i continue to use the old
method
> of
> building where clauses?
I never thought that these methods were a good idea to add to PEAR::DB.
But today there is even less reason with the availability of two
alternative layers to put ontop of PEAR::DB in the form of DB_QueryTool
and DB_DataObject's that are much better fit to offer this type of
interface to an RDBMS.
So I would rather discourage further additions to these methods.
-1 from me.
Regards,
Lukas