RRVARMA Posted May 19, 2008 Share Posted May 19, 2008 Hi, Please tell me how to find the total number of rows fetched my a query. I'm getting the rows from Teradata and not using MySql. i tried with the following but in vain.. //$rows=odbc_num_rows($query); //echo $rows; //$rows= "SELECT count(*) as result FROM (".$query.")"; //echo $rows; //$num_rows = mysql_num_rows($query); //echo $num_rows; $totrows=odbc_fetch_row($query); echo $totrows; //$totrows=ROW_COUNT($query); //echo $totrows; Please help.. Thanks, RRVARMA Quote Link to comment Share on other sites More sharing options...
aaronson Posted May 19, 2008 Share Posted May 19, 2008 http://ca.php.net/manual/en/function.odbc-num-rows.php * didnt see you tried that, im still asleep :-\ try printing your query... make sure its correct Quote Link to comment Share on other sites More sharing options...
aaronson Posted May 19, 2008 Share Posted May 19, 2008 if you cant find a work around i would just loop all the records and count each loop to get the total number of records, just a thought Quote Link to comment Share on other sites More sharing options...
RRVARMA Posted May 19, 2008 Author Share Posted May 19, 2008 Hi aaronson, Its working.. The script is working. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.