Re: Re: PEAR::DB 1.6.4 problem with quoteSmart()
| From: | Justin Patrin | Date: | Thu, 01 Jul 2004 06:58:38 +0000 |
| Subject: | Re: Re: PEAR::DB 1.6.4 problem with quoteSmart() | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13430@lists.php.net to get a copy of this message | ||
Also, quoteSmart is for quoting values, not identifiers. The correct
function for this is quoteIdentifier():
$query = 'select * from '.$db->quoteIdentifier($table);
On Thu, 24 Jun 2004 15:31:28 +1000, Aidan Lister <aidan@php.net> wrote:
>
> Hi Torsten,
>
> On a side note, a good way of writing your queries is using sprintf();
>
> $query = sprintf("select * from %s", quotesmart($database));
>
> This removes the PHP from the queries making them much more portable and
> less obfuscated.
>
> "Torsten Roehr" <roehr@zilleon.com> wrote in message
> news:20040630184535.62320.qmail@pb1.pair.com...
>
>
> > "Stephan Schmidt" <schst@php.net> wrote in message
> > news:40E305DA.2020409@php.net...
> > > Hi,
> > >
> > > Torsten Roehr wrote:
> > >
> > > > Thanks, Michael. Now I see what the 'smart' stands for... Have to
> adapt
> > all
> > > > my SQL statements now.
> > >
> > > If you do not want DB to place quotes around your values, you may also
> > > use escapeSimple().
> > >
> >
> hÕ÷
> H¿±;žÅKÚêèhttp://pear.php.net/manual/en/package.database.db.db-common.escapesimple.php
> > >
> > > Stephan
> >
> > Thanks, Stephan! Could have seen this myself, arrrgh...
> >
> > Torsten
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> !DSPAM:40e39fbb36908669215710!
>
>
--
paperCrane --Justin Patrin--