Lame ODBC Query Engine?
| From: | Beau Lebens | Date: | Tue, 17 Jul 2001 05:43:18 +0000 |
| Subject: | Lame ODBC Query Engine? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-10509@lists.php.net to get a copy of this message | ||
guys and gals,
as sad as i am to admit it, i am in the process of converting a php project
into ASP. this means i am using an dobc connection to connect to the exact
same database as i was using under php (it's a mysql database, so using the
myodbc driver on win2k machine) and i am having some problems.
the following query works wonderfully on php/mysql, gives me exactly what i
want and i'm very happy with it
SELECT DISTINCT(Files.fileID),COUNT(Files.fileID) AS
counter,Files.title,Files.artist FROM Files,Downloads WHERE
Downloads.what=Files.fileID GROUP BY Files.fileID ORDER BY counter
DESC,Downloads.time DESC LIMIT 10
when i use the same query on ASP/ODBC->MySQL, i get *nothing* no error, no
recordset, nothing :P
except for the limit 10 clause, that query returns hundreds of results, so
there's heaps there, i don't know if anyone out there knows some ASP (i
don't :P just learning!) but everything else seems to be ok, just that the
ODBC driver (at least for MySQL) is just ignoring the select statement.
i have tried playing with the select and as far as i can tell, the problem
is to do with the use of COUNT and GROUP BY - are these allowed in ODBC
queries? i have hunted the microsoft site for odbc documentation and the
only links to it are all broken :P (thank you microsoft for your endless
faux pas)
anyhoo - any help would be greatly appreciated as i am getting to the stage
where i am going to do some bizzarro select and then filter the results into
arrays or soemthing if i can't get it sorted soon :)
thanks folx
beau
===============================================================
Beau F Lebens, Technical Officer
National Key Centre for School Science and Mathematics
Science and Mathematics Education Centre
Curtin University of Technology,
GPO Box U1987 Perth, Western Australia 6845
mailto:b.lebens@smec.curtin.edu.au
http://learnt.smec.curtin.edu.au/
Univ: Tel +61 8 9266 7297 (v-mail);
Fax +61 8 9266-2503
===============================================================