Made it so class does query counting. Cleaned up errors.
git-svn-id: https://develop.svn.wordpress.org/trunk@563 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
778d159be0
commit
cc566a54fa
|
@ -31,12 +31,14 @@
|
||||||
|
|
||||||
if ( ! $this->dbh )
|
if ( ! $this->dbh )
|
||||||
{
|
{
|
||||||
$this->print_error("<ol id='error'>
|
$this->print_error("<div id='error'>
|
||||||
<li><strong>Error establishing a database connection!</strong></li>
|
<p><strong>Error establishing a database connection!</strong></p>
|
||||||
|
<ul>
|
||||||
<li>Are you sure you have the correct user/password?</li>
|
<li>Are you sure you have the correct user/password?</li>
|
||||||
<li>Are you sure that you have typed the correct hostname?</li>
|
<li>Are you sure that you have typed the correct hostname?</li>
|
||||||
<li>Are you sure that the database server is running?</li>
|
<li>Are you sure that the database server is running?</li>
|
||||||
</ol>");
|
</ul>
|
||||||
|
</div>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,10 +92,10 @@
|
||||||
if ( $this->show_errors )
|
if ( $this->show_errors )
|
||||||
{
|
{
|
||||||
// If there is an error then take note of it
|
// If there is an error then take note of it
|
||||||
print "<ol id='error'>
|
print "<div id='error'>
|
||||||
<li><strong>SQL/DB Error --</strong></li>
|
<p><strong>SQL/DB Error:</strong><br />
|
||||||
<li>[<font color=000077>$str</font>]</li>
|
[<span style='color: #007;'>$str</span>]</p>
|
||||||
</ol>";
|
</div>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -145,6 +147,7 @@
|
||||||
|
|
||||||
// Perform the query via std mysql_query function..
|
// Perform the query via std mysql_query function..
|
||||||
$this->result = mysql_query($query, $this->dbh);
|
$this->result = mysql_query($query, $this->dbh);
|
||||||
|
++$this->querycount;
|
||||||
|
|
||||||
// If there was an insert, delete or update see how many rows were affected
|
// If there was an insert, delete or update see how many rows were affected
|
||||||
// (Also, If there there was an insert take note of the insert_id
|
// (Also, If there there was an insert take note of the insert_id
|
||||||
|
@ -157,6 +160,7 @@
|
||||||
if ( preg_match("/^\\s*$word /i",$query) )
|
if ( preg_match("/^\\s*$word /i",$query) )
|
||||||
{
|
{
|
||||||
$this->rows_affected = mysql_affected_rows();
|
$this->rows_affected = mysql_affected_rows();
|
||||||
|
$this->querybump();
|
||||||
|
|
||||||
// This gets the insert ID
|
// This gets the insert ID
|
||||||
if ( $word == 'insert' || $word == 'replace' )
|
if ( $word == 'insert' || $word == 'replace' )
|
||||||
|
|
Loading…
Reference in New Issue