summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-includes/wp-db.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-08-27 17:36:51 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-08-27 17:36:51 +0000
commitbe9fc29f2bfa0c237e0ec12570cfa6c7adc39158 (patch)
tree54074f1140ab2a8ca20101919f3660e2146d6c54 /wp-inst/wp-includes/wp-db.php
parentf6c2c76550d2db67cc389c8c6aedcc0d4129b8f1 (diff)
Send create table and alter table sql to the proper db creation code.
Fixed mysql_error() checking. git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@246 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/wp-db.php')
-rw-r--r--wp-inst/wp-includes/wp-db.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/wp-inst/wp-includes/wp-db.php b/wp-inst/wp-includes/wp-db.php
index 38125de..810cc11 100644
--- a/wp-inst/wp-includes/wp-db.php
+++ b/wp-inst/wp-includes/wp-db.php
@@ -140,7 +140,7 @@ class wpdb {
$action = 'global';
$details = $global_db_list[ mt_rand( 0, count( $global_db_list ) -1 ) ];
$this->db_global = $details;
- } elseif ( preg_match("/^\\s*(insert|delete|update|replace) /i",$query) ) {
+ } elseif ( preg_match("/^\\s*(alter table|create|insert|delete|update|replace) /i",$query) ) {
$action = 'write';
$details = $db_list[ 'write' ][ mt_rand( 0, count( $db_list[ 'write' ] ) -1 ) ];
$this->db_write = $details;
@@ -217,9 +217,11 @@ class wpdb {
$this->queries[] = array( $query, $this->timer_stop() );
// If there is an error then take note of it..
- if ( mysql_error() ) {
- $this->print_error();
- return false;
+ if( $dbh ) {
+ if ( mysql_error( $dbh ) ) {
+ $this->print_error( mysql_error( $dbh ));
+ return false;
+ }
}
if ( preg_match("/^\\s*(insert|delete|update|replace) /i",$query) ) {