note 39272 added to function.odbc-num-rows

From: Date: Thu, 22 Jan 2004 18:04:43 +0000
Subject: note 39272 added to function.odbc-num-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-64029@lists.php.net to get a copy of this message
I use SELECT count(*) method and use WHILE loop to pickup the result of value. In reality, these WHILE loop will loop only one time, because it has only 1 line result in return. // count how many records of that table // (odbc_num_rows function has some error with ACCESS, can't use it) $sql_count_rows="SELECT count(*) FROM $tbl_name"; $result_count_rows = odbc_exec($conn_dsn, $sql_count_rows) or die('Select failed!'); while(odbc_fetch_row($result_count_rows)){ $n_rcd=odbc_result($result_count_rows,1); // value 1 mean the 1st field of record } echo $n_rcd."<br>"; ---- Manual Page -- http://www.php.net/manual/en/function.odbc-num-rows.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39272 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39272&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39272&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#64029) next »