summaryrefslogtreecommitdiff
path: root/maintenance/sql.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/sql.php')
-rw-r--r--maintenance/sql.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/maintenance/sql.php b/maintenance/sql.php
index 38c995ac..ab6546b9 100644
--- a/maintenance/sql.php
+++ b/maintenance/sql.php
@@ -53,15 +53,15 @@ class SqlPromptPrinter {
}
}
-function sqlPrintResult( $res ) {
+function sqlPrintResult( $res, $db ) {
if ( !$res ) {
// Do nothing
- } elseif ( $res->numRows() ) {
+ } elseif ( is_object( $res ) && $res->numRows() ) {
while ( $row = $res->fetchObject() ) {
print_r( $row );
}
} else {
- $affected = $res->db->affectedRows();
+ $affected = $db->affectedRows();
echo "Query OK, $affected row(s) affected\n";
}
}