phpBB

Code Changes

File: includes/db/dbal.php

  Unmodified   Added   Modified   Removed
Line 192Line 192
		}

return false;

		}

return false;

 
	}

/**
* Seek to given row number
* rownum is zero-based
*/
function sql_rowseek($rownum, &$query_id)
{
global $cache;

if ($query_id === false)
{
$query_id = $this->query_result;
}

if (isset($cache->sql_rowset[$query_id]))
{
return $cache->sql_rowseek($rownum, $query_id);
}

if ($query_id === false)
{
return false;
}

$this->sql_freeresult($query_id);
$query_id = $this->sql_query($this->last_query_text);

if ($query_id === false)
{
return false;
}

// We do not fetch the row for rownum == 0 because then the next resultset would be the second row
for ($i = 0; $i < $rownum; $i++)
{
if (!$this->sql_fetchrow($query_id))
{
return false;
}
}

return true;

	}

/**

	}

/**

Line 455Line 498
		}

return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');

		}

return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');

 
	}

/**
* Run LOWER() on DB column of type text (i.e. neither varchar nor char).
*
* @param string $column_name The column name to use
*
* @return string A SQL statement like "LOWER($column_name)"
*/
function sql_lower_text($column_name)
{
return "LOWER($column_name)";

	}

/**

	}

/**

Line 662Line 717
			// The DEBUG_EXTRA constant is for development only!
if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA'))
{

			// The DEBUG_EXTRA constant is for development only!
if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA'))
{

				// Print out a nice backtrace...
$backtrace = get_backtrace();


 
				$message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : '';

				$message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : '';

				$message .= ($backtrace) ? '<br /><br />BACKTRACE<br />' . $backtrace : '';
$message .= '<br />';

 
			}
else
{

			}
else
{

Line 777Line 827
							</div>
</div>
<div id="page-footer">

							</div>
</div>
<div id="page-footer">

							Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group

							Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group

						</div>
</div>
</body>

						</div>
</div>
</body>

Line 904Line 954
		}

return true;

		}

return true;

 
	}

/**
* Gets the estimated number of rows in a specified table.
*
* @param string $table_name Table name
*
* @return string Number of rows in $table_name.
* Prefixed with ~ if estimated (otherwise exact).
*
* @access public
*/
function get_estimated_row_count($table_name)
{
return $this->get_row_count($table_name);
}

/**
* Gets the exact number of rows in a specified table.
*
* @param string $table_name Table name
*
* @return string Exact number of rows in $table_name.
*
* @access public
*/
function get_row_count($table_name)
{
$sql = 'SELECT COUNT(*) AS rows_total
FROM ' . $this->sql_escape($table_name);
$result = $this->sql_query($sql);
$rows_total = $this->sql_fetchfield('rows_total');
$this->sql_freeresult($result);

return $rows_total;

	}
}


	}
}