From cc566a54fa4f856439c51179f39a3633e81a7ade Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Thu, 4 Dec 2003 19:02:21 +0000 Subject: [PATCH] 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 --- b2-include/wp-db.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/b2-include/wp-db.php b/b2-include/wp-db.php index 34a9b00382..ba829699b8 100644 --- a/b2-include/wp-db.php +++ b/b2-include/wp-db.php @@ -31,12 +31,14 @@ if ( ! $this->dbh ) { - $this->print_error("
    -
  1. Error establishing a database connection!
  2. + $this->print_error("
    +

    Error establishing a database connection!

    +
    • Are you sure you have the correct user/password?
    • Are you sure that you have typed the correct hostname?
    • Are you sure that the database server is running?
    • -
"); + + "); } @@ -90,10 +92,10 @@ if ( $this->show_errors ) { // If there is an error then take note of it - print "
    -
  1. SQL/DB Error --
  2. -
  3. [$str]
  4. -
"; + print "
+

SQL/DB Error:
+ [$str]

+
"; } else { @@ -145,6 +147,7 @@ // Perform the query via std mysql_query function.. $this->result = mysql_query($query, $this->dbh); + ++$this->querycount; // 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 @@ -157,6 +160,7 @@ if ( preg_match("/^\\s*$word /i",$query) ) { $this->rows_affected = mysql_affected_rows(); + $this->querybump(); // This gets the insert ID if ( $word == 'insert' || $word == 'replace' )