//
// Constructor
//
- function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
+ function __construct($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
{
$this->persistency = $persistency;
$this->user = $sqluser;
} // if ... define
-?>
\ No newline at end of file
+?>
function _odbc_execute_query($query)
{
$result = false;
-
+
if (eregi("^SELECT ", $query))
{
$result = @odbc_exec($this->db_connect_id, $query);
{
$this->sql_transaction('rollback');
}
-
+
trigger_error($message, E_USER_ERROR);
}
} // if ... define
-?>
\ No newline at end of file
+?>
if (!$this->query_result)
{
$this->num_queries++;
-
+
if (($this->query_result = @mssql_query($query, $this->db_connect_id)) === false)
{
$this->sql_error($query);
}
$row = @mssql_fetch_array($query_id, MSSQL_ASSOC);
-
+
if ($row)
{
foreach ($row as $key => $value)
{
$this->sql_transaction('rollback');
}
-
+
trigger_error($message, E_USER_ERROR);
}
} // if ... define
-?>
\ No newline at end of file
+?>
case 'commit':
$result = @mysql_query('COMMIT', $this->db_connect_id);
$this->transaction = false;
-
+
if (!$result)
{
@mysql_query('ROLLBACK', $this->db_connect_id);
}
return $result;
}
-
+
return false;
}
return mysql_escape_string($msg);
}
}
-
+
function sql_error($sql = '')
{
if (!$this->return_on_error)
{
$this->sql_transaction('rollback');
}
-
+
trigger_error($message, E_USER_ERROR);
}
{
$html_table = TRUE;
$html_hold .= '<table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"><tr>';
-
+
foreach (array_keys($row) as $val)
{
$html_hold .= '<th nowrap="nowrap">' . (($val) ? ucwords(str_replace('_', ' ', $val)) : ' ') . '</th>';
} // if ... define
-?>
\ No newline at end of file
+?>
case 'commit':
$result = @mysql_query('COMMIT', $this->db_connect_id);
$this->transaction = false;
-
+
if (!$result)
{
@mysql_query('ROLLBACK', $this->db_connect_id);
}
return $result;
}
-
+
return false;
}
return mysql_escape_string($msg);
}
}
-
+
function sql_error($sql = '')
{
if (!$this->return_on_error)
{
$this->sql_transaction('rollback');
}
-
+
trigger_error($message, E_USER_ERROR);
}
{
$html_table = TRUE;
$html_hold .= '<table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"><tr>';
-
+
foreach (array_keys($row) as $val)
{
$html_hold .= '<th nowrap="nowrap">' . (($val) ? ucwords(str_replace('_', ' ', $val)) : ' ') . '</th>';
} // if ... define
-?>
\ No newline at end of file
+?>
}
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
-
+
if (!$this->query_result)
{
$this->num_queries++;
unset($this->rowset[$cur_index]);
unset($this->row[$cur_index]);
-
+
$result = array();
while ($this->rowset[$cur_index] = $this->sql_fetchrow($query_id))
{
else
{
$cur_index = (is_object($query_id)) ? $query_id->cur_index : $query_id;
-
+
if (empty($this->row[$cur_index]) && empty($this->rowset[$cur_index]))
{
if ($this->row[$cur_index] = $this->sql_fetchrow($query_id))
function sql_escape($msg) {
return mysqli_real_escape_string($this->db_connect_id, $msg);
}
-
+
function sql_error($sql = '')
{
if (!$this->return_on_error)
{
$this->sql_transaction('rollback');
}
-
+
trigger_error($message, E_USER_ERROR);
}
{
$html_table = TRUE;
$html_hold .= '<table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"><tr>';
-
+
foreach (array_keys($row) as $val)
{
$html_hold .= '<th nowrap="nowrap">' . (($val) ? ucwords(str_replace('_', ' ', $val)) : ' ') . '</th>';
} // if ... define
-?>
\ No newline at end of file
+?>
//
// Constructor
//
- function sql_db($sqlserver, $sqluser, $sqlpassword, $database="", $persistency = true)
+ function __construct($sqlserver, $sqluser, $sqlpassword, $database="", $persistency = true)
{
$this->persistency = $persistency;
$this->user = $sqluser;
} // if ... define
-?>
\ No newline at end of file
+?>
{
$this->connect_string .= "host=$sqlserver ";
}
-
+
if ($port)
{
$this->connect_string .= "port=$port ";
}
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
-
+
if (!$this->query_result)
{
$this->num_queries++;
}
$result = @pg_fetch_array($query_id, NULL, PGSQL_ASSOC);
-
+
if ($result)
{
$this->rownum[$query_id]++;
{
$this->sql_transaction('rollback');
}
-
+
trigger_error($message, E_USER_ERROR);
}
} // if ... defined
-?>
\ No newline at end of file
+?>
{
$this->sql_transaction('rollback');
}
-
+
trigger_error($message, E_USER_ERROR);
}
} // if ... define
-?>
\ No newline at end of file
+?>
* @param object Reader the StreamReader object
* @param boolean enable_cache Enable or disable caching of strings (default on)
*/
- function gettext_reader($Reader, $enable_cache = true) {
+ function __construct($Reader, $enable_cache = true) {
// If there isn't a StreamReader, turn on short circuit mode.
if (! $Reader || isset($Reader->error) ) {
$this->short_circuit = true;
};
class StringReader {
- var $_pos;
+ var $_pos = 0;
var $_str;
- function StringReader($str='') {
+ function __construct($str='') {
$this->_str = $str;
- $this->_pos = 0;
}
function read($bytes) {
var $_fd;
var $_length;
- function FileReader($filename) {
+ function __construct($filename) {
if (file_exists($filename)) {
$this->_length=filesize($filename);
// Preloads entire file in memory first, then creates a StringReader
// over it (it assumes knowledge of StringReader internals)
class CachedFileReader extends StringReader {
- function CachedFileReader($filename) {
+ function __construct($filename) {
if (file_exists($filename)) {
$length=filesize($filename);