[support] d7, passing functions in db_insert()
Don
donald at fane.com
Tue Dec 23 02:45:38 UTC 2014
Thanks. Looks like db_query() is the only way to go.
-Don-
On 12/22/2014 4:12 PM, Pierre Rineau wrote:
> Le lundi 22 décembre 2014 à 15:36 -0500, Don a écrit :
>> I know i've done this before, but I can't remember now.
>>
>> Given
>> $id = db_insert('stats_table')
>> ->fields(array(
>> 'created' => 'now()',
>> ))
>> ->execute();
>>
>> More interested in how to pass functions than in getting it to work.
> I don't know the answer for db_insert(), but for db_select() you would
> do something like:
>
> db_select('some_table')
> ->addExpression("RAW SQL STATEMENT");
>
> When you don't really know how, db_query() is your friend.
>
> --
> Pierre
>
>
--
--
-Don Pickerel-
Fane Software
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20141222/711a7010/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fane-th.png
Type: image/png
Size: 18361 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/support/attachments/20141222/711a7010/attachment.png
More information about the support
mailing list