<div>Hi All</div>
<div>I am using Drupal 6.20.</div>
<div> </div>
<div>I have constructured below query.</div>
<div> </div>
<div>str = <strong>SELECT name, id, lft, rgt FROM resubmt_skill_ids AS node WHERE ( <a href="http://node.name/" target="_blank">node.name</a> LIKE &quot;%sip%&quot;) ORDER BY node.lft</strong></div>
<div> </div>
<div>Then I call db_query() API.</div>
<div> </div>
<div>It did not return the expected records.</div>
<div> </div>
<div>On debugging, looks the query went as </div>
<div> </div>
<div><strong>SELECT name, id, lft, rgt FROM resubmt_skill_ids AS node WHERE ( <a href="http://node.name/" target="_blank">node.name</a> LIKE &quot;ip%&quot;) ORDER BY node.lft</strong></div>
<div> </div>
<div>Probably db_query API , considered %s as a string placeholder and removed from query string.</div>
<div> </div>
<div>Then I changed the query to </div>
<div> </div>
<div><strong>SELECT name, id, lft, rgt FROM resubmt_skill_ids AS node WHERE ( <a href="http://node.name/" target="_blank">node.name</a> LIKE &quot;<font color="#ff0000">%</font>%sip%&quot;) ORDER BY node.lft</strong></div>

<div> </div>
<div>Above query returns expected records.</div>
<div> </div>
<div>My question is , when a token starts with &quot;s&quot;, we will be facing above issue.</div>
<div>What is the best way to resolve it.</div>
<div> </div>
<div>Can I follow the mechanism, where tokens starting with &quot;s&quot;, will be changed to &quot;%s&quot; , so that in query the token will look like &quot;%%s&quot;. Or do yo see any issues with this approach.</div>
<div> </div>
<div>Regards</div>
<div>Austin</div>
<div> </div>
<div> </div>
<div> </div>