jenkins-bot has submitted this change and it was merged.

Change subject: Statistics: replace mysql with mysqli command
......................................................................


Statistics: replace mysql with mysqli command

PatchSet 2: Changed to object model

Change-Id: I515d80c2bf56f949422561daa8912c16a674cb9f
---
M Statistics/includes/MySQLDbReader.class.php
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Mglaser: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Statistics/includes/MySQLDbReader.class.php 
b/Statistics/includes/MySQLDbReader.class.php
index 3cac052..e21083e 100644
--- a/Statistics/includes/MySQLDbReader.class.php
+++ b/Statistics/includes/MySQLDbReader.class.php
@@ -61,11 +61,11 @@
                $sql = str_replace("@start", " 
'".$interval->getStartTS("YmdHis")."' ", $sql);
                $sql = str_replace("@end", " 
'".$interval->getEndTS("YmdHis")."' ", $sql);
 
-               $res = mysql_query($sql);
+               $res = $this->conn->query($sql);
                if (!$res){
                        return 0;
                }
-               $row = mysql_fetch_array($res);
+               $row = $res->fetch_array();
 
                $item = $row[0];
                //if ($listable)
@@ -92,12 +92,12 @@
                $sql = str_replace("@start", " 
'".$interval->getStartTS("YmdHis")."' ", $sql);
                $sql = str_replace("@end", " 
'".$interval->getEndTS("YmdHis")."' ", $sql);
 //echo '<br>'.$sql;
-               $res = mysql_query($sql);
+               $res = $this->conn->query($sql);
                if (!$res){
                        return $uniqueValues;
                }
 
-               while ($row = mysql_fetch_array($res)) {
+               while ( $row = $res->fetch_array() ) {
                        $rowArr = array();
                        for ($i=0; $i<$count; $i++ )
                                $rowArr[] = $row[$i];
@@ -117,8 +117,8 @@
        private function connect()
        {
                if ($this->conn) return $this->conn;
-               $this->conn = mysql_connect($this->host, $this->user, 
$this->pass);
-               mysql_select_db($this->db);
+               $this->conn = new mysqli($this->host, $this->user, $this->pass);
+               $this->conn->select_db($this->db);
                return $this->conn;
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/304993
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I515d80c2bf56f949422561daa8912c16a674cb9f
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Ljonka <[email protected]>
Gerrit-Reviewer: Dvogel hallowelt <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to