Hi there,
I've got a site hosted at an ISP and everything was going well when they
decided to upgrade the software. Now my site is running under Win2K, IIS5,
MySQL 3.23.33 and MyODBC 2.50.36.
In order to get easier to explain what is going wrong, I've built the
following test:
CREATE TABLE person (
person_ID INTEGER NULL,
name CHAR(50) NULL,
gender CHAR(1) NULL
);
INSERT INTO person (person_id, name, gender) values
(1,'Bob','m'),(2,'Mary','f'),(3,'Antony','m'),(4,'Rose','f'),(5,'Kuerten','m');
mysql> select count(*) as quantity, gender
-> from person
-> group by gender;
+----------+--------+
| quantity | gender |
+----------+--------+
| 2 | f |
| 3 | m |
+----------+--------+
2 rows in set (0.01 sec)
*** As you can realize, so far so good. Now things get worse ***
<html>
<head>
<title>GROUP BY TEST</title>
</head>
<body bgcolor="#FFFFFF">
<%
Response.Write "Begin<br>"
strConn =
"DRIVER=MySQL;SERVER=myserver;DATABASE=mydatabase;UID=myuser;PWD=mypass;"
Set conn = Server.Createobject("ADODB.Connection")
conn.Open(strConn)
strSQL = "select count(*) as quantity, gender "
strSQL = strSQL & "from person "
strSQL = strSQL & "group by gender;"
Response.Write strSQL & "<BR>"
Set Rs = conn.Execute(strSQL)
While Not Rs.EOF
Response.Write "Quantity: " & RS("quantity") & " - Gender: " &
RS("gender") & "<BR>"
Rs.MoveNext
Wend
Rs.Close
conn.close
response.write "The End<br>"
%>
</body>
</html>
*** The page above should print:
Begin
select count(*) as quantity, gender from person group by gender;
Quantity: 2 - Gender: f
Quantity: 3 - Gender: m
The End
*** Instead, I'm getting this:
Begin
select count(*) as quantity, gender from person group by gender;
The End
*** It means that the record set is empty.
Thank you very much for any help.
Regards,
Celso.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
---------------------------------------------------------------------
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