f0bc975e by Marty Penner

Fix a few incorrectly-merged mysql queries

1 parent c9fcec32
...@@ -32,7 +32,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable { ...@@ -32,7 +32,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
32 protected $count = 0; 32 protected $count = 0;
33 protected $num_rows = 0; 33 protected $num_rows = 0;
34 34
35 protected $fields = Array(); 35 protected $fields = [];
36 36
37 protected $userclass = 'User'; 37 protected $userclass = 'User';
38 38
...@@ -91,7 +91,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable { ...@@ -91,7 +91,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
91 } 91 }
92 } 92 }
93 93
94 mysql_query("SET SESSION group_concat_max_len = 40960", $wpdb->dbh); 94 mysqli_query("SET SESSION group_concat_max_len = 40960", $wpdb->dbh);
95 95
96 $query = " 96 $query = "
97 SELECT SQL_CALC_FOUND_ROWS 97 SELECT SQL_CALC_FOUND_ROWS
...@@ -119,11 +119,11 @@ class UserSearch implements ArrayAccess, Iterator, Countable { ...@@ -119,11 +119,11 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
119 {$limit_clause} 119 {$limit_clause}
120 "; 120 ";
121 121
122 $this->result = mysql_query($query, $wpdb->dbh); 122 $this->result = mysqli_query($wpdb->dbh, $query);
123 $this->num_rows = mysql_num_rows($this->result); 123 $this->num_rows = mysqli_num_rows($this->result);
124 124
125 $count_result = mysql_query("SELECT FOUND_ROWS()", $wpdb->dbh); 125 $count_result = mysqli_query($wpdb->dbh, "SELECT FOUND_ROWS()");
126 list($this->count) = mysql_fetch_row($count_result); 126 list($this->count) = mysqli_fetch_row($count_result);
127 } 127 }
128 128
129 public function setUserClass($classname) { 129 public function setUserClass($classname) {
...@@ -154,7 +154,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable { ...@@ -154,7 +154,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
154 $this->current = 0; 154 $this->current = 0;
155 155
156 if ($this->num_rows > 0) { 156 if ($this->num_rows > 0) {
157 mysql_data_seek($this->result, 0); 157 mysqli_data_seek($this->result, 0);
158 } 158 }
159 } 159 }
160 160
...@@ -176,10 +176,10 @@ class UserSearch implements ArrayAccess, Iterator, Countable { ...@@ -176,10 +176,10 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
176 } 176 }
177 177
178 if ($offset != $this->pos) { 178 if ($offset != $this->pos) {
179 mysql_data_seek($this->result, $offset); 179 mysqli_data_seek($this->result, $offset);
180 } 180 }
181 181
182 list($user_id, $user_string) = mysql_fetch_row($this->result); 182 list($user_id, $user_string) = mysqli_fetch_row($this->result);
183 $user_string = str_ireplace("\\'", "\\\\'", $user_string); 183 $user_string = str_ireplace("\\'", "\\\\'", $user_string);
184 $json_data = json_decode($user_string, true); 184 $json_data = json_decode($user_string, true);
185 if (json_last_error() != JSON_ERROR_NONE) { 185 if (json_last_error() != JSON_ERROR_NONE) {
......