Re: cvs: php4 /pear/DB common.php
| From: | Stig S. Bakken | Date: | Sat, 24 Nov 2001 09:00:21 +0000 |
| Subject: | Re: cvs: php4 /pear/DB common.php | ||
| References: | 1 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-1401@lists.php.net to get a copy of this message | ||
Perl DBI uses do() for this. I think we should adopt that, for less
typing. :-)
- Stig
"Thomas V.V.Cox" wrote:
>
> cox Fri Nov 23 07:52:11 2001 EDT
>
> Modified files:
> /php4/pear/DB common.php
> Log:
> Added a new method executeQuery() that prepares and execute a statement
> (don't you do that too many times?)
>
>
> Index: php4/pear/DB/common.php
> diff -u php4/pear/DB/common.php:1.70 php4/pear/DB/common.php:1.71
> --- php4/pear/DB/common.php:1.70 Thu Nov 8 08:53:44 2001
> +++ php4/pear/DB/common.php Fri Nov 23 07:52:11 2001
> @@ -17,7 +17,7 @@
> // | |
> // +----------------------------------------------------------------------+
> //
> -// $Id: common.php,v 1.70 2001/11/08 13:53:44 cox Exp $
> +// $Id: common.php,v 1.71 2001/11/23 12:52:11 cox Exp $
> //
> // Base class for DB implementations.
> //
> @@ -432,6 +432,20 @@
> }
> }
> return DB_OK;
> + }
> +
> + // }}}
> + // {{{ executeQuery()
> +
> + /**
> + * Prepares and Execute a statement
> + * @param string $query The query to treat
> + * @param array $data The data to be added to the query
> + */
> + function executeQuery($query, $data = false)
> + {
> + $stmt = $this->prepare($query);
> + return $this->execute($stmt, $data);
> }
>
> // }}}
>
> --
> PEAR CVS Mailing List (http://pear.php.net/)
> To unsubscribe, e-mail: pear-cvs-unsubscribe@lists.php.net
> For additional commands, e-mail: pear-cvs-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net