I keep getting this error when trying to use PEAR DB's numRows() function.
it works fine on my development server, but when I try the same exact code on my test server it throws that error. this is my script.
| Code: |
| Fatal error: Call to undefined function: numrows() in /var/www/html/pantours_net/admin/list_users.php on line 36 |
it works fine on my development server, but when I try the same exact code on my test server it throws that error. this is my script.
| Code: |
| <?php
if ($_SESSION['admin_level'] < 2) { die('<br /><br /><p align="center">You do not have permission to access this section</p>'); } require('DB.php'); require('DB/Pager.php'); //require the PEAR::DB classes. $db_engine = 'mysql'; $db_user = 'panda'; $db_pass = 'panda1234'; $db_host = 'localhost'; $db_name = 'pantours'; $dsn = $db_engine.'://'. $db_user.':'. $db_pass.'@'. $db_host.'/'. $db_name; $db = DB::connect($dsn, TRUE); if(DB::isError($db)) { die($db->getMessage()); } $db->setFetchMode(DB_FETCHMODE_ASSOC); $from=0; if (isset($_GET['from'])) {$from=$_GET['from']; } if (empty($_GET['from'])) {$from=0; } $limit = 40; $nrows = 0; $maxpages = 10; $sql = "SELECT * FROM user WHERE user_inactive != '1'"; $total = $db->query($sql); $res = $db->limitQuery($sql,$from,$limit); $nrows = $total->numRows(); $data = DB_Pager::getData($from, $limit, $maxpages); |
