NYCPHP Meetup

[nycphp-talk] PHP/MySQL environment problem??

PaulCheung paulcheung at tiscali.co.uk
Mon Mar 3 00:58:07 EST 2008


HELP - I have tried everything I can think of, taken onboard suggestions and 
still cannot understand why my record counter works in the Windows 
Environment and not in Linus Environment. Here is the code can anybody see 
what is wrong??

<?PHP SESSION_START(); ob_start();
$self     = $_SERVER['PHP_SELF'];
$referer  = $_SERVER['HTTP_REFERER'];
$access   = $_SESSION['access'];
//
 @ $cps;  //Current Page Starting row number
 @ $lps;  //Last Page Starting row number
 @ $rpp;  //Records Per Page
//
 include("tp_database.php");
 mysql_connect($db_host,$db_user,$db_password);
 mysql_select_db($db_database) or die("Unable to select database");
//
 if(empty($_GET["cps"]))
 {  $cps = "0"; }
 else
 { $cps = $_GET["cps"];  }
//
 $rpp = "001";
//
 $q="SELECT SQL_CALC_FOUND_ROWS *
     FROM tr_test_record
  WHERE $access = tr_access";
//
 $rs=mysql_query($q) or die(mysql_error());
//
 $q0="Select FOUND_ROWS()";
//
 $rs0=mysql_query($q0) or die(mysql_error());
//
 $row0=mysql_fetch_array($rs0);
//
 $nr0 = $row0["FOUND_ROWS()"];  //Number of rows found without LIMIT in 
action
?>

Thanks - Paul





More information about the talk mailing list