From e1114fe2bbb6f4ee85e3b171e5ad909da844c6d9 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Thu, 4 Dec 2003 19:02:21 +0000 Subject: [PATCH] Made it so class does query counting. Cleaned up errors. git-svn-id: http://svn.automattic.com/wordpress/trunk@563 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 34a9b0038..ba829699b 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' )