Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f0bc975e
authored
2014-11-18 16:12:14 -0500
by
Marty Penner
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix a few incorrectly-merged mysql queries
1 parent
c9fcec32
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
lib/UserSearch.php
lib/UserSearch.php
View file @
f0bc975
...
...
@@ -32,7 +32,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
protected
$count
=
0
;
protected
$num_rows
=
0
;
protected
$fields
=
Array
()
;
protected
$fields
=
[]
;
protected
$userclass
=
'User'
;
...
...
@@ -91,7 +91,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
}
}
mysql_query
(
"SET SESSION group_concat_max_len = 40960"
,
$wpdb
->
dbh
);
mysql
i
_query
(
"SET SESSION group_concat_max_len = 40960"
,
$wpdb
->
dbh
);
$query
=
"
SELECT SQL_CALC_FOUND_ROWS
...
...
@@ -119,11 +119,11 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
{
$limit_clause
}
"
;
$this
->
result
=
mysql
_query
(
$query
,
$wpdb
->
dbh
);
$this
->
num_rows
=
mysql_num_rows
(
$this
->
result
);
$this
->
result
=
mysql
i_query
(
$wpdb
->
dbh
,
$query
);
$this
->
num_rows
=
mysql
i
_num_rows
(
$this
->
result
);
$count_result
=
mysql
_query
(
"SELECT FOUND_ROWS()"
,
$wpdb
->
dbh
);
list
(
$this
->
count
)
=
mysql_fetch_row
(
$count_result
);
$count_result
=
mysql
i_query
(
$wpdb
->
dbh
,
"SELECT FOUND_ROWS()"
);
list
(
$this
->
count
)
=
mysql
i
_fetch_row
(
$count_result
);
}
public
function
setUserClass
(
$classname
)
{
...
...
@@ -154,7 +154,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
$this
->
current
=
0
;
if
(
$this
->
num_rows
>
0
)
{
mysql_data_seek
(
$this
->
result
,
0
);
mysql
i
_data_seek
(
$this
->
result
,
0
);
}
}
...
...
@@ -176,10 +176,10 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
}
if
(
$offset
!=
$this
->
pos
)
{
mysql_data_seek
(
$this
->
result
,
$offset
);
mysql
i
_data_seek
(
$this
->
result
,
$offset
);
}
list
(
$user_id
,
$user_string
)
=
mysql_fetch_row
(
$this
->
result
);
list
(
$user_id
,
$user_string
)
=
mysql
i
_fetch_row
(
$this
->
result
);
$user_string
=
str_ireplace
(
"
\\
'"
,
"
\\\\
'"
,
$user_string
);
$json_data
=
json_decode
(
$user_string
,
true
);
if
(
json_last_error
()
!=
JSON_ERROR_NONE
)
{
...
...
Please
register
or
sign in
to post a comment