Working on getting Oracle functional. Almost there, need to deal with the 'AUTO INCREMENT' issue

git-svn-id: file:///svn/phpbb/trunk@520 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
James Atkinson 2001-06-21 03:20:37 +00:00
parent 8276d5728c
commit 6e9bc6b0fc
4 changed files with 42 additions and 34 deletions

View file

@ -96,7 +96,7 @@ if(!$result = $db->sql_query($sql))
else else
{ {
$config = $db->sql_fetchrow($result); $config = $db->sql_fetchrow($result);
$board_config['sitename'] = stripslashes($config['sitename']); $board_config['sitename'] = stripslashes($config['sitename']);
$board_config['allow_html'] = $config['allow_html']; $board_config['allow_html'] = $config['allow_html'];
$board_config['allow_bbcode'] = $config['allow_bbcode']; $board_config['allow_bbcode'] = $config['allow_bbcode'];

View file

@ -45,11 +45,11 @@ class sql_db
if($this->persistency) if($this->persistency)
{ {
$this->db_connect_id = OCIPLogon($this->user, $this->password, $this->server); $this->db_connect_id = @OCIPLogon($this->user, $this->password, $this->server);
} }
else else
{ {
$this->db_connect_id = OCINLogon($this->user, $this->password, $this->server); $this->db_connect_id = @OCINLogon($this->user, $this->password, $this->server);
} }
if($this->db_connect_id) if($this->db_connect_id)
{ {
@ -70,9 +70,9 @@ class sql_db
{ {
if($this->query_result) if($this->query_result)
{ {
OCIFreeStatement($this->query_result); @OCIFreeStatement($this->query_result);
} }
$result = OCILogoff($this->db_connect_id); $result = @OCILogoff($this->db_connect_id);
return $result; return $result;
} }
else else
@ -107,8 +107,8 @@ class sql_db
} }
} }
$this->query_result = OCIParse($this->db_connect_id, $query); $this->query_result = @OCIParse($this->db_connect_id, $query);
$success = OCIExecute($this->query_result); $success = @OCIExecute($this->query_result);
} }
if($success) if($success)
{ {
@ -133,10 +133,10 @@ class sql_db
} }
if($query_id) if($query_id)
{ {
$result = OCIFetchStatement($query_id, $this->rowset); $result = @OCIFetchStatement($query_id, $this->rowset);
// OCIFetchStatment kills our query result so we have to execute the statment again // OCIFetchStatment kills our query result so we have to execute the statment again
// if we ever want to use the query_id again. // if we ever want to use the query_id again.
OCIExecute($query_id); @OCIExecute($query_id);
return $result; return $result;
} }
else else
@ -168,7 +168,7 @@ class sql_db
} }
if($query_id) if($query_id)
{ {
$result = OCINumCols($query_id); $result = @OCINumCols($query_id);
return $result; return $result;
} }
else else
@ -187,7 +187,7 @@ class sql_db
} }
if($query_id) if($query_id)
{ {
$result = strtolower(OCIColumnName($query_id, $offset)); $result = strtolower(@OCIColumnName($query_id, $offset));
return $result; return $result;
} }
else else
@ -205,7 +205,7 @@ class sql_db
} }
if($query_id) if($query_id)
{ {
$result = OCIColumnType($query_id, $offset); $result = @OCIColumnType($query_id, $offset);
return $result; return $result;
} }
else else
@ -221,12 +221,13 @@ class sql_db
} }
if($query_id) if($query_id)
{ {
$result = OCIFetchInto($query_id, &$this->row[$query_id], OCI_ASSOC);
$result = @OCIFetchInto($query_id, &$this->row[$query_id], OCI_ASSOC);
for($i = 0; $i < count($this->row[$query_id]); $i++) for($i = 0; $i < count($this->row[$query_id]); $i++)
{ {
list($key, $val) = each($this->row[$query_id]); list($key, $val) = each($this->row[$query_id]);
$return_arr[strtolower($key)] = $val; $return_arr[strtolower($key)] = $val;
} }
$this->row[$query_id] = $return_arr; $this->row[$query_id] = $return_arr;
return $this->row[$query_id]; return $this->row[$query_id];
} }
@ -245,11 +246,11 @@ class sql_db
} }
if($query_id) if($query_id)
{ {
$rows = OCIFetchStatement($query_id, $results); $rows = @OCIFetchStatement($query_id, $results);
OCIExecute($query_id); @OCIExecute($query_id);
for($i = 0; $i <= $rows; $i++) for($i = 0; $i <= $rows; $i++)
{ {
OCIFetchInto($query_id, $tmp_result, OCI_ASSOC+OCI_RETURN_NULLS); @OCIFetchInto($query_id, $tmp_result, OCI_ASSOC+OCI_RETURN_NULLS);
for($j = 0; $j < count($tmp_result); $j++) for($j = 0; $j < count($tmp_result); $j++)
{ {
@ -276,20 +277,20 @@ class sql_db
if($rownum > -1) if($rownum > -1)
{ {
// Reset the internal rownum pointer. // Reset the internal rownum pointer.
OCIExecute($query_id); @OCIExecute($query_id);
for($i = 0; $i < $rownum; $i++) for($i = 0; $i < $rownum; $i++)
{ {
// Move the interal pointer to the row we want // Move the interal pointer to the row we want
OCIFetch($query_id); @OCIFetch($query_id);
} }
// Get the field data. // Get the field data.
$result = OCIResult($query_id, strtoupper($field)); $result = @OCIResult($query_id, strtoupper($field));
} }
else else
{ {
// The internal pointer should be where we want it // The internal pointer should be where we want it
// so we just grab the field out of the current row. // so we just grab the field out of the current row.
$result = OCIResult($query_id, strtoupper($field)); $result = @OCIResult($query_id, strtoupper($field));
} }
return $result; return $result;
} }
@ -306,12 +307,12 @@ class sql_db
} }
if($query_id) if($query_id)
{ {
OCIExecute($query_id); @OCIExecute($query_id);
for($i = 0; $i < $rownum; $i++) for($i = 0; $i < $rownum; $i++)
{ {
OCIFetch($query_id); @OCIFetch($query_id);
} }
$result = OCIFetch($query_id); $result = @OCIFetch($query_id);
return $result; return $result;
} }
else else
@ -339,7 +340,7 @@ class sql_db
} }
if($query_id) if($query_id)
{ {
$result = OCIFreeStatement($query_id); $result = @OCIFreeStatement($query_id);
return $result; return $result;
} }
else else
@ -353,7 +354,7 @@ class sql_db
{ {
$query_id = $this->query_result; $query_id = $this->query_result;
} }
$result = OCIError($query_id); $result = @OCIError($query_id);
return $result; return $result;
} }

View file

@ -86,11 +86,15 @@ if(!$result)
$logged_online = 0; $logged_online = 0;
$guests_online = 0; $guests_online = 0;
while($row = $db->sql_fetchrow($result))
$row = $db->sql_fetchrowset($result);
$num_rows = $db->sql_numrows($result);
for($x = 0; $x < $num_rows; $x++)
{ {
if($row['session_logged_in'])
if($row[$x]['session_logged_in'])
{ {
$userlist_ary[] = "<a href=\"".append_sid("profile." . $phpEx . "?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . "\">" . $row['username'] . "</a>"; $userlist_ary[] = "<a href=\"".append_sid("profile." . $phpEx . "?mode=viewprofile&" . POST_USERS_URL . "=" . $row[$x]['user_id']) . "\">" . $row[$x]['username'] . "</a>";
$logged_online++; $logged_online++;
} }
else else
@ -98,6 +102,7 @@ while($row = $db->sql_fetchrow($result))
$guests_online++; $guests_online++;
} }
} }
$userlist = ""; $userlist = "";
for($i = 0; $i < $logged_online; $i++) for($i = 0; $i < $logged_online; $i++)
{ {

View file

@ -59,6 +59,7 @@ function session_begin($user_id, $user_ip, $page_id, $session_length, $login = 0
{ {
error_die(SQL_QUERY, "Couldn't obtain ban information.", __LINE__, __FILE__); error_die(SQL_QUERY, "Couldn't obtain ban information.", __LINE__, __FILE__);
} }
$ban_info = $db->sql_fetchrow($result); $ban_info = $db->sql_fetchrow($result);
// //
@ -244,9 +245,9 @@ function session_pagestart($user_ip, $thispage_id, $session_length)
error_die(SESSION_CREATE); error_die(SESSION_CREATE);
} }
} }
$userdata = $db->sql_fetchrow($result); $userdata = $db->sql_fetchrow($result);
// //
// Did the session exist in the DB? // Did the session exist in the DB?
// //
@ -327,6 +328,7 @@ function session_pagestart($user_ip, $thispage_id, $session_length)
error_die(SESSION_CREATE); error_die(SESSION_CREATE);
} }
} }
$userdata = $db->sql_fetchrow($result); $userdata = $db->sql_fetchrow($result);
if($userdata['user_autologin_key']) if($userdata['user_autologin_key'])