[support] D7 Sql USING syntax

Ms. Nancy Wichmann nan_wich at bellsouth.net
Fri Sep 21 14:57:21 UTC 2012


  $result = db_query("SELECT id, exp, name FROM {resubmt_users_skills} LEFT JOIN {resubmt_skill_ids} USING (id) WHERE resubmt_users_skills.uid = :uid", array(':uid' => $user.uid))->fetchAssoc();

That should work just fine and doesn't require the overhead of dynamic queries. I'm not too sure about the fetchAssoc() because I don't bother with array results any more.

See http://drupal.org/node/310072
 
Nancy 

Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.



>________________________________
> From: Kamal Palei
>
>
>Thanks Nicolas
>Tried your suggestion. It worked. Thanks.
> 
>Nancy, I did not understand your comment "do not convert select query", can you kindly elaborate on it.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20120921/b6ee039b/attachment.html 


More information about the support mailing list