[support] Place holders in SQL query
Austin Einter
austin.einter at gmail.com
Mon Apr 11 00:55:16 UTC 2011
1.
When we do a SQL query, if we want to pass value to query, we make use %d
for integers or %s for strings.
Similarly do we have any place holders for arrays.
2.
I am facing a below typical problem, can somebody tell me what should I do?
Below query works fine.
SELECT skillid FROM {resubmt_skills} WHERE resubmt_skills.skillname
IN (*'PHP',
'HTML', 'SQL'*)
But in above query search string *'PHP', 'HTML', 'SQL' *is hard coded.
I want to make the query generic.
Lets say in custom search form, user entered search string PHP, Telecom,
HTML,, so how can I write a generic query.
Thanks
Austin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110411/ee8f1cd3/attachment.html
More information about the support
mailing list