<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
This syntax is a hold over from the old C programming language and I
have seen several of the newer Drupal books recommending it, not
sure if there is a preference in D7. but essentially what nan wich
(intrigued by the name) says is correct, if you build your query
string it (as should all strings) begin with a single or double
quote and end with the same. I personally can't see any problem
coding multiple %s and %d placeholders in one string then coding
them as a list of variables, but don't forget that your string and
list need to be passed to a function (fscanf comes to mind), but I
believe the new drupal get db functions (sorry I don't remember
their names) do this.<br>
<br>
Warren Vail<br>
<br>
On 4/10/2011 5:55 PM, Austin Einter wrote:
<blockquote
cite="mid:BANLkTimnWPrLvki=yXq_MswuVr29OU7TFw@mail.gmail.com"
type="cite">
<div>1. </div>
<div>When we do a SQL query, if we want to pass value to query, we
make use %d for integers or %s for strings.</div>
<div>Similarly do we have any place holders for arrays. </div>
<div> </div>
<div> </div>
<div>2.</div>
<div>I am facing a below typical problem, can somebody tell me
what should I do?</div>
<div> </div>
<div>Below query works fine.</div>
<div>SELECT skillid FROM {resubmt_skills} WHERE
resubmt_skills.skillname IN (<strong>'PHP', 'HTML', 'SQL'</strong>)
</div>
<div> </div>
<div>But in above query search string <strong>'PHP', 'HTML',
'SQL' </strong>is hard coded.</div>
<div>I want to make the query generic.</div>
<div> </div>
<div>Lets say in custom search form, user entered search string
PHP, Telecom, HTML,, so how can I write a generic query.</div>
<div> </div>
<div>Thanks</div>
<div>Austin </div>
</blockquote>
<br>
</body>
</html>