Problem
My (windows) server is showing an odd error when I use a query. However locally the query works just fine. The server adds  everywhere in the query.
The Error
Error Executing Database Query.
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 ‘.product
= ao_products.id where ao_ranks.target = ‘1’ order by
ao_ranks.rank as’ at line 1<cfset start = (page*perpage)-perpage> <cfquery name="get"> select category,ao_products.id,model,name,rank,ratingfrom ao_ranks inner join ao_products
on ao_ranks.product =ÂÂ
ao_products.id where ao_ranks.target =
‘#target#’ order by ao_ranks.rank asc
limit #start#,#perpage#VENDORERRORCODE 1064
SQLSTATE 42000
SQL select
category,ao_products.id,model,name,rank,rating
from ao_ranks inner join ao_products
on ao_ranks.product = ao_products.id
where ao_ranks.target = ‘1’ order by
ao_ranks.rank asc limit 0,16
The Code (utf-8 encoded file)
<cfelse>
<cfset start = (page*perpage)-perpage>
<cfquery name="get">
select category,ao_products.id,model,name,rank,rating from ao_ranks inner join ao_products on ao_ranks.product = ao_products.id where ao_ranks.target = '#target#' order by ao_ranks.rank asc limit #start#,#perpage#
</cfquery>
</cfif>
I solved this by capitalizing “on” in the query. I have no clue how this helped. But it did.