[development] Best practice for update_sql?

Khalid Baheyeldin kb at 2bits.com
Fri Feb 29 20:17:21 UTC 2008


Moreover, update_sql() does not accept % arguments. It only accepts one
argument
with is the SQL, so you have to concatenate what you need apriori.

On Fri, Feb 29, 2008 at 3:05 PM, Earnie Boyd <earnie at users.sourceforge.net>
wrote:

> Quoting mark burdett <mfburdett at gmail.com>:
>
> > On Fri, Feb 29, 2008 at 8:01 AM, Earnie Boyd
> > <earnie at users.sourceforge.net> wrote:
> >>  $sql[] = "UPDATE {profile_files} SET category = '%s' WHERE
> >>  LOWER(category) = '%s'";
> >>  $sql[] = 'Account settings';
> >>  $sql[] = 'account';
> >>  $ret[] = update_sql($sql);
> >
> > I guess this was an example of how it could work but doesn't?
> > update_sql and db_query need a string as their argument and first
> > argument, respectively.
> >
>
> Sorry, yes, I misread db_query.  What good is update_sql then?  Hmm...
> I find a two plus years old ticket for this [1].
>
> [1] http://drupal.org/node/36324
>
>


-- 
Khalid M. Baheyeldin
2bits.com, Inc.
http://2bits.com
Drupal optimization, development, customization and consulting.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20080229/d32d9809/attachment.htm 


More information about the development mailing list