Jump to content

how do i get the number of rows in php odbc without using odbc_num_rows


worldcomingtoanend

Recommended Posts

from http://php.net/manual/en/function.odbc-num-rows.php:

Two workarounds:

  1. When you just need to verify that any rows returned from your query you can use select count(*) as cnt from table and then just get $row['cnt']

  2. When you need to actually loop through the records this function returns number of rows in the recordset if and only if you include ORDER BY clause in your query statement.

 

so, it seems adding an 'ORDER BY' to your query might work

from http://php.net/manual/en/function.odbc-num-rows.php:

Two workarounds:

  1. When you just need to verify that any rows returned from your query you can use select count(*) as cnt from table and then just get $row['cnt']

  2. When you need to actually loop through the records this function returns number of rows in the recordset if and only if you include ORDER BY clause in your query statement.

 

so, it seems adding an 'ORDER BY' to your query might work

 

thank you so much jskywalker  that worked like a charm...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.