<div>Anth</div>
<div>Thanks for help.</div>
<div> </div>
<div>I tried this option, still get '\' warning.</div>
<div> </div>
<div>$skill = "PHP, TML, HTML";<br> $pieces = explode(",", $skill);<br> $in_string = "'" . implode("','", $pieces) . "'";</div>
<div> <br>$query = db_query("SELECT name, email, phone, yrsofexp FROM {resubmt_table} <br> WHERE resubmt_table.uid IN (SELECT DISTINCT uid FROM {resubmt_users_skills} <br> WHERE resubmt_users_skills.skillid IN(SELECT skillid FROM {resubmt_skills} <br>
WHERE resubmt_skills.skillname IN (%s)))", $in_string); </div>
<div> </div>
<div> </div>
<div>I get the warning </div>
<div> </div>
<div><font color="#ff6600">user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'PHP\',\' TML\',\' HTML\')))' at line 4 query: SELECT name, email, phone, yrsofexp FROM resubmt_table WHERE resubmt_table.uid IN (SELECT DISTINCT uid FROM resubmt_users_skills WHERE resubmt_users_skills.skillid IN(SELECT skillid FROM resubmt_skills WHERE resubmt_skills.skillname IN (\'PHP\',\' TML\',\' HTML\'))) in C:\MyWeb6.20\wamp\www\livejobs1\sites\default\modules\resume_search\resume_search.module on line 126.</font></div>
<div><font color="#ff6600"></font> </div>
<div><br>Thanks</div>
<div>Austin<br></div>
<div class="gmail_quote">On Mon, Apr 11, 2011 at 7:00 AM, Anth <span dir="ltr"><<a href="mailto:malkouna@yahoo.com.au">malkouna@yahoo.com.au</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div bgcolor="#ffffff" text="#000000"><big><font size="-1"><big><tt>Sometimes you can't control what you're getting for your IN statement...<br><br>Try something like:<br><br>$string = "PHP,HTML,SQL";<br>
$pieces = explode(",", $string);<br>$in_string = "'" . implode("','", $pieces) . "'";</tt></big></font></big><font size="-1"><font face="Helvetica, Arial, sans-serif"><br>
</font></font><br>On 6:59 AM, nan wich wrote:
<blockquote type="cite">
<div style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 12pt">
<div>In Drupal code, you should <strong>never</strong> find a query with %s that is not surrounded by quotes. To do what you are looking for check the db_placeholders function in the API docs.<br> </div>
<p><font color="#ff007f" size="4" face="bookman old style, new
york, times, serif"><em><strong>Nancy</strong></em></font></p>
<p> </p>
<p><font face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</font></p>
<div><br></div>
<div style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 12pt"><br>
<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><font size="2" face="Tahoma">
<hr size="1">
<b><span style="FONT-WEIGHT: bold">From:</span></b> Austin Einter <<a href="mailto:austin.einter@gmail.com" target="_blank">austin.einter@gmail.com</a>><br><b><span style="FONT-WEIGHT: bold">To:</span></b> <a href="mailto:support@drupal.org" target="_blank">support@drupal.org</a><br>
<b><span style="FONT-WEIGHT: bold">Sent:</span></b> Sun, April 10, 2011 8:23:57 PM<br><b><span style="FONT-WEIGHT: bold">Subject:</span></b> [support] String conversion<br></font><br>
<div>Hi </div>
<div>I have a below string.</div>
<div><strong>PHP, HTML, SQL</strong></div>
<div>Want to convert it to</div>
<div><strong>'PHP', 'HTML', 'SQL'</strong></div>
<div> </div>
<div>I tried to write a function to do it as below. If I print the function output it prints properly.</div>
<div>If same function output I use for SQL query as below I get warning.</div>
<div> </div>
<div>Query: SELECT skillid FROM {resubmt_skills} WHERE resubmt_skills.skillname IN (%s)", $fSkill</div>
<div><font color="#ff0000">Warning: SELECT skillid FROM resubmt_skills WHERE resubmt_skills.skillname IN (\'ITI\',\' PHP\'))) in C:\MyWeb6.20\wamp\www\livejobs1\sites\default\modules\resume_search\resume_search.module on line 140.</font></div>
<div> </div>
<div>Looks it has extra forward slashes. How can I overcome this.</div>
<div> </div>
<div>Thanks</div>
<div>Austin</div>
<div> </div>
<div> </div>
<div> </div></div></div></div></blockquote></div><br>--<br>[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br>