That's a bit odd--so if you leave that query exactly like that, but
remove the avg function, it runs OK?  And if you run that exact query
*with* the avg function in the MySQL query browser (not familiar with
this but I assume it's just a GUI to hit MySQL ...), it runs OK? 
Guessing here, but if that's the case it sounds like maybe the
database driver you're using doesn't know how to deal with the avg()
function.  Hitting it from the query browser may *not* use a JDBC
driver (again, I don't know that tool so maybe it does), or if it
does, it might be using a different driver than the one you're using. 
If you're using MySQL 5 with CF 7 I assume you downloaded the latest
drivers from mysql.com; otherwise I don't think it would talk to MySQL
at all.  Check the drivers because it sounds like something's getting
lost in translation on the JDBC side of things.

Matt

On 1/27/06, Chris Gomez <[EMAIL PROTECTED]> wrote:
> I'm working on a script that allows user to rate a item. the script works
> fine for inserting the data and seamlessly returning to the page (using
> Ajax). The problem I'm having is when the page reloads or, when I load
> another item page, I get a JDBC internal error on the select statement (see
> below). I am using MySQL 5 and CFMX 7. I've run the select statement through
> the MySQL Query Browser and it runs fine. The script works if I remove the
> AVG function. But, that means I have to add extra code to get the average
> rating for the unit, which I'd rather not do.
>
>  <cfquery name="getRating" datasource="#dsn#">
>      select avg(fldrating) as Rating from tblrate where id = #uID#
>  </cfquery>
>
>  Any ideas/suggestions appreciated.
>
>  thanks,
>
>  Chris
> --
> "Fortune favors the prepared mind."
> - Louis Pasteur
> _______________________________________________
> Reply to DFWCFUG:
>   [email protected]
> Subscribe/Unsubscribe:
>   http://lists1.safesecureweb.com/mailman/listinfo/list
> List Archives:
>     http://www.mail-archive.com/list%40list.dfwcfug.org/
>   http://www.mail-archive.com/list%40dfwcfug.org/
> DFWCFUG Sponsors:
>   www.HostMySite.com
>   www.teksystems.com/
>
>
>


--
Matt Woodward
[EMAIL PROTECTED]
http://www.mattwoodward.com

_______________________________________________
Reply to DFWCFUG:
  [email protected]
Subscribe/Unsubscribe:
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
    http://www.mail-archive.com/list%40list.dfwcfug.org/
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
  www.HostMySite.com
  www.teksystems.com/

Reply via email to