| re: require_once('DB.php') failure
I've added the error_reporting(E_ALL) and it didn't show me anything.
I've had the mysql_error() check after each DB call and they've yet to
return an error. When the script fails I just see nothing. If I drop
in an echo statement before the require_once('DB.php') call it comes
through, but anything after doesn't. Below is the code...
====db_login.php====
<?php
require_once('DB.php');
// SET CONNECTION VARIABLES
$username = 'xxxxxx';
$password = 'xxxxxx';
$hostspec = 'db1.xxxxxx.net';
$database = 'xxxxxxDB';
$phptype = 'mysql';
$dsn =
$phptype.'://'.$username.':'.$password.'@'.$hostspec.'/'.$database;
// CONNECT
$db = DB::connect($dsn);
if(DB::iserror($db)){
die($db->getMessage());
}
?>
====db_getProjects.php====
<?php
require_once('db_login.php');
//QUERY-------------------------------------------
$sql = "SELECT * FROM Projects ORDER BY County";
$q = $db->query($sql);
if(DB::iserror($q)){
die($q->getMessage());
}
$varList = "";
//CONSTRUCT VARIABLE LIST------------------------
while ($row = $q->fetchRow(DB_FETCHMODE_OBJECT)){
if(DB::iserror($row)){
die($row->getMessage());
}
$varList .= $row->County."^".$row->Title."^".$row->Link."^^";
}
$db->disconnect();
echo '&projects='.rtrim($varList,'^');
?> |