Thank you. swimming way out of my depth!
Not sure I see anything like you suggest should be there.
The previous lines of code are:
Constructs a new Db object, connects to the db server and
selects the desired database.
*/
function Db($DB_HOST, $DB_USER, $DB_PASSWD, $DB_DBNAME, $oe = 'report')
{
$this->on_error = $oe;
$this->server = $DB_HOST;
$this->dbname = $DB_DBNAME;
$this->user = $DB_USER;
$this->password = $DB_PASSWD;
$this->limit = $GLOBALS['LIMIT'];
$this->show_pages_number = 1;
$this->number_type == 'number';
$this->qcounter = 0;
$this->connect();
}
function connect($server='', $user='', $password='', $dbname='')
{
if ($server)
{
$this->server = $server;
$this->dbname = $user;
$this->user = $password;
$this->password = $dbname;
}
$this->connection = @mysql_connect( $this->server, $this->user, $this->password )
or $this->error( "could not connect to the database server ($this->server, $this->user)." );
@mysql_select_db( $this->dbname )
or $this->error( "could not select the database ($this->DB)." );
}
/*!
executes query, returns query result handle
*/
function &query($q, $print = false)
{
if ($print) { echo "<br/><b>query: </b>" . htmlentities($q) . "<br/>";}
($this->queryresult =& mysql_query($q, $this->connection)) or
followed by:
$this->error("<b>bad SQL query</b>: " . htmlentities($q) . "<br/><b>". mysql_error() ."</b>");
$this->qcounter++;
$this->qall[] = $q;
return $this->queryresult;
}
Not sure if this helps?