Warnung: file_put_contents(/home/www/web1/html/php_dev/test.txt) [function.file-put-contents]: failed to open stream: Permission denied in /home/www/web1/html/php_dev/sys/lib.activity.php (Zeile 58)
odbc_num_rows funzt nicht :( [Archiv] - PHP-Scripte PHP-Tutorials PHP-Jobs und vieles mehr

- Ad -
php-resource




Archiv verlassen und diese Seite im Standarddesign anzeigen :
odbc_num_rows funzt nicht :(


 
JoelH
03-01-2002, 14:52 
 
Ist eine AccessDB die ich per php und odbc anspreche.
Der Query "SELECT Index FROM Auto WHERE Index > 101"
funktioniert unter Access tadelos und es kommt als anzahl der Datensätze 915 raus, wenn ich jetzt allerdings dies im Script einbaue und dann per odbc_num_rows versuche eben diese Anzahl raus zu bekommen kommt -1 raus :(
Warum ?

Hab ich schon gesagt das ich diesen M$ Müll hasse ? Nur Probleme, wo man hinschaut :(

 
Sky
03-01-2002, 15:00 
 
Note: Using odbc_num_rows() to determine the number of rows available after a SELECT will return -1 with many drivers.

ntp@panda.bg.unv.gda.pl
22-Mar-2001 06:31
An alternative way of getting the number of rows if your driver returns -1 is to requery using the above query: SELECT Count(*) FROM (SELECT ... original query); I don't only know which solution is faster: to requery, or to fetch lot of rows (it depends on how does SQL engine does Count operation)

 
JoelH
03-01-2002, 15:03 
 
also
SELECT count(*) FROM (SELECT Index FROM Auto WHERE Index > 101)

Das soll gehen ?

Naja, ich sag auch immer : "Die Wege des Windows sind unergründlich :(".

- -

Alle Zeitangaben in WEZ +2. Es ist jetzt 15:16 Uhr.