mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-07 16:15:22 +02:00
Trying something
git-svn-id: file:///svn/phpbb/trunk@3660 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
f81602d72b
commit
df495c30c9
@ -86,7 +86,6 @@ class sql_db
|
|||||||
{
|
{
|
||||||
case 'begin':
|
case 'begin':
|
||||||
$this->transaction = true;
|
$this->transaction = true;
|
||||||
$result = ibase_trans();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'commit':
|
case 'commit':
|
||||||
@ -136,6 +135,11 @@ class sql_db
|
|||||||
$this->sql_error($query);
|
$this->sql_error($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$this->transaction)
|
||||||
|
{
|
||||||
|
@ibase_commit();
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($_GET['explain']))
|
if (!empty($_GET['explain']))
|
||||||
{
|
{
|
||||||
$endtime = explode(' ', microtime());
|
$endtime = explode(' ', microtime());
|
||||||
@ -279,7 +283,7 @@ class sql_db
|
|||||||
|
|
||||||
function sql_affectedrows()
|
function sql_affectedrows()
|
||||||
{
|
{
|
||||||
return 0;// ??
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sql_fetchrow($query_id = 0)
|
function sql_fetchrow($query_id = 0)
|
||||||
@ -327,6 +331,7 @@ class sql_db
|
|||||||
{
|
{
|
||||||
$query_id = $this->query_result;
|
$query_id = $this->query_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($query_id)
|
if ($query_id)
|
||||||
{
|
{
|
||||||
if ($rownum > -1)
|
if ($rownum > -1)
|
||||||
@ -369,21 +374,33 @@ class sql_db
|
|||||||
$query_id = $this->query_result;
|
$query_id = $this->query_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($query_id) ? @mysql_data_seek($query_id, $rownum) : false;
|
for($i = 1; $i < $rownum; $i++)
|
||||||
|
{
|
||||||
|
if (!$this->sql_fetchrow($query_id))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sql_nextid()
|
function sql_nextid()
|
||||||
{
|
{
|
||||||
$query = "SELECT currval('" . $tablename[1] . "_id_seq') AS last_value";
|
if ($this->query_result)
|
||||||
$temp_q_id = @ibase_query($this->db_connect_id, $query);
|
{
|
||||||
if( !$temp_q_id )
|
$query = "SELECT Gen_ID('" . $tablename[1] . "_id_seq',1) AS last_value
|
||||||
|
FROM RDB\$DATABASE";
|
||||||
|
if (!($temp_q_id = @ibase_query($this->db_connect_id, $query)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp_result = @pg_fetch_array($temp_q_id, 0, PGSQL_ASSOC);
|
$temp_result = @ibase_fetch_object($temp_q_id);
|
||||||
|
$this->sql_freeresult($temp_q_id);
|
||||||
|
|
||||||
return ( $temp_result ) ? $temp_result['last_value'] : false;
|
return ($temp_result) ? $temp_result->last_value : false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sql_freeresult($query_id = false)
|
function sql_freeresult($query_id = false)
|
||||||
@ -393,7 +410,7 @@ class sql_db
|
|||||||
$query_id = $this->query_result;
|
$query_id = $this->query_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($query_id) ? @mysql_free_result($query_id) : false;
|
return ($query_id) ? @ibase_free_result($query_id) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sql_escape($msg)
|
function sql_escape($msg)
|
||||||
@ -413,12 +430,12 @@ class sql_db
|
|||||||
$this_page =(!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
$this_page =(!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||||
$this_page .= '&' .((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
$this_page .= '&' .((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
||||||
|
|
||||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @mysql_error() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . $this_page . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @ibase_errmsg() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . $this_page .(($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||||
trigger_error($message, E_USER_ERROR);
|
trigger_error($message, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result['message'] = @mysql_error();
|
$result['message'] = @ibase_errmsg();
|
||||||
$result['code'] = @mysql_errno();
|
$result['code'] = '';
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
@ -409,7 +409,6 @@ class sql_db
|
|||||||
|
|
||||||
function sql_escape($msg)
|
function sql_escape($msg)
|
||||||
{
|
{
|
||||||
// return str_replace("'", "''", str_replace('\\', '\\\\', $msg));
|
|
||||||
return mysql_escape_string(stripslashes($msg));
|
return mysql_escape_string(stripslashes($msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,9 +33,7 @@ class sql_db
|
|||||||
var $sql_report = '';
|
var $sql_report = '';
|
||||||
var $sql_time = 0;
|
var $sql_time = 0;
|
||||||
|
|
||||||
//
|
|
||||||
// Constructor
|
// Constructor
|
||||||
//
|
|
||||||
function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $port, $persistency = false)
|
function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $port, $persistency = false)
|
||||||
{
|
{
|
||||||
$this->open_queries = array();
|
$this->open_queries = array();
|
||||||
@ -60,9 +58,7 @@ class sql_db
|
|||||||
$this->sql_error('');
|
$this->sql_error('');
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Other base methods
|
// Other base methods
|
||||||
//
|
|
||||||
function sql_close()
|
function sql_close()
|
||||||
{
|
{
|
||||||
if (!$this->db_connect_id)
|
if (!$this->db_connect_id)
|
||||||
@ -97,17 +93,17 @@ class sql_db
|
|||||||
{
|
{
|
||||||
case 'begin':
|
case 'begin':
|
||||||
$this->transaction = true;
|
$this->transaction = true;
|
||||||
$result = mysql_query('BEGIN', $this->db_connect_id);
|
$result = @mysql_query('BEGIN', $this->db_connect_id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'commit':
|
case 'commit':
|
||||||
$this->transaction = false;
|
$this->transaction = false;
|
||||||
$result = mysql_query('COMMIT', $this->db_connect_id);
|
$result = @mysql_query('COMMIT', $this->db_connect_id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'rollback':
|
case 'rollback':
|
||||||
$this->transaction = false;
|
$this->transaction = false;
|
||||||
$result = mysql_query('ROLLBACK', $this->db_connect_id);
|
$result = @mysql_query('ROLLBACK', $this->db_connect_id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -117,9 +113,7 @@ class sql_db
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Base query method
|
// Base query method
|
||||||
//
|
|
||||||
function sql_query($query = '', $expire_time = 0)
|
function sql_query($query = '', $expire_time = 0)
|
||||||
{
|
{
|
||||||
if ($query != '')
|
if ($query != '')
|
||||||
@ -284,12 +278,10 @@ class sql_db
|
|||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Other query methods
|
// Other query methods
|
||||||
//
|
//
|
||||||
// NOTE :: Want to remove _ALL_ reliance on sql_numrows from core code ...
|
// NOTE :: Want to remove _ALL_ reliance on sql_numrows from core code ...
|
||||||
// don't want this here by a middle Milestone
|
// don't want this here by a middle Milestone
|
||||||
//
|
|
||||||
function sql_numrows($query_id = false)
|
function sql_numrows($query_id = false)
|
||||||
{
|
{
|
||||||
if (!$query_id)
|
if (!$query_id)
|
||||||
@ -412,8 +404,7 @@ class sql_db
|
|||||||
|
|
||||||
function sql_escape($msg)
|
function sql_escape($msg)
|
||||||
{
|
{
|
||||||
// return str_replace("'", "''", str_replace('\\', '\\\\', $msg));
|
return @mysql_escape_string(stripslashes($msg));
|
||||||
return mysql_escape_string(stripslashes($msg));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sql_error($sql = '')
|
function sql_error($sql = '')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user