I am not sure if I am doing something wrong in mySQL, but I have tested the
following in Microsoft SQL, Access and Oracle it works fine in those
environments, but unfortunately, it does not work in mySQL.
I have a simple query, such as:
select name, count(*) from tbl_users group by name;
In the mySQL client, this query returns the proper results. However, if I
create an ASP page to deliver the results it does not work. It returns 0
records. However, if I remove count(*) from the query, it will then return the
records just not in the format I want it. Like I said, this works fine in
Microsoft SQL, Access and Oracle.
My ASP code is as follows:
<%
set oRS = server.createobject("ADODB.Recordset")
set oDB = server.createobject("ADODB.Connection")
oDB.Open "DSN=<dsn name>"
sSQL = "SELECT name, count(*) from tbl_users group by name;"
oRS.Open sSQL, oDB
if not oRS.EOF then
while not oRS.EOF
response.write oRS("NAME")
oRS.MoveNext
wend
else
response.write "No Records Found"
end if
oRS.Close
oDb.Close
set oRS = nothing
set oDB = nothing
%>
Any suggestions or assistance on this would be greatly appreciated.
Thanks
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php