<div dir="ltr">Why you are using mysql in that ??<br><br>I thing that also is the error<br><br><br><br><div class="gmail_quote">On Mon, Sep 22, 2008 at 4:36 PM, Fred Jones <span dir="ltr"><<a href="mailto:fredthejonester@gmail.com">fredthejonester@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Here is some trivial code:<br>
<br>
$n= db_query($countsql) ;<br>
echo "<!-- ";print_r(db_fetch_array($n)); echo " -->";<br>
$countsql = str_replace('{','',$countsql);<br>
$countsql = str_replace('}','',$countsql);<br>
$resultXXX = mysql_query($countsql);<br>
echo "<!-- ";print_r(mysql_fetch_array($resultXXX)); echo " -->";<br>
<br>
which runs my $countsql through db_query, shows the result and then<br>
through mysql_query and shows the results. The two other lines just<br>
remove the { and } characters. I would have expected to see the same<br>
results both times, but what I see is:<br>
<br>
<!-- Array<br>
(<br>
[COUNT(*)] => 0<br>
)<br>
--><!-- Array<br>
(<br>
[0] => 4<br>
[COUNT(*)] => 4<br>
)<br>
--><br>
<br>
The mysql_query version returns the correct result--that is what I see<br>
if I run the query via phpMyAdmin as well. Seems that Drupal's<br>
db_query is doing something to it. The operative issue is the use of<br>
UCASE I am quite certain. I wanted to make my LIKE phrase case<br>
insensitive, so I added UCASE to both sides of it, but now db_query<br>
fails.<br>
<br>
Anyone have any feedback on this? I would not be opposed to just using<br>
mysql_query but the query in question I actually want to pass to<br>
pager_query, which in turn of course passes it to db_query.<br>
<br>
Thanks.<br>
<font color="#888888">--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</font></blockquote></div><br></div>