Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PHP-MySQLi-Database-Class
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
PHP-MySQLi-Database-Class
Commits
71d38c2e
Commit
71d38c2e
authored
Aug 17, 2015
by
Alexander Butenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style fixes
parent
b5068c0a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
17 deletions
+11
-17
MysqliDb.php
MysqliDb.php
+11
-17
No files found.
MysqliDb.php
View file @
71d38c2e
...
...
@@ -308,7 +308,7 @@ class MysqliDb
$this
->
_query
=
$query
;
$stmt
=
$this
->
_prepareQuery
();
if
(
is_array
(
$bindParams
)
===
true
)
{
if
(
is_array
(
$bindParams
)
===
true
)
{
foreach
(
$bindParams
as
$prop
=>
$val
)
{
$params
[
0
]
.=
$this
->
_determineType
(
$val
);
array_push
(
$params
,
$bindParams
[
$prop
]);
...
...
@@ -916,9 +916,8 @@ class MysqliDb
// if $meta is false yet sqlstate is true, there's no sql error but the query is
// most likely an update/insert/delete which doesn't produce any results
if
(
!
$meta
&&
$stmt
->
sqlstate
)
{
if
(
!
$meta
&&
$stmt
->
sqlstate
)
return
array
();
}
$row
=
array
();
while
(
$field
=
$meta
->
fetch_field
())
{
...
...
@@ -976,9 +975,8 @@ class MysqliDb
$totalCount
=
$stmt
->
fetch_row
();
$this
->
totalCount
=
$totalCount
[
0
];
}
if
(
$this
->
returnType
==
'Json'
)
{
if
(
$this
->
returnType
==
'Json'
)
return
json_encode
(
$results
);
}
return
$results
;
}
...
...
@@ -1189,9 +1187,8 @@ class MysqliDb
*/
protected
function
_prepareQuery
()
{
if
(
!
$stmt
=
$this
->
mysqli
()
->
prepare
(
$this
->
_query
))
{
throw
new
Exception
(
"Problem preparing query (
$this->_query
) "
.
$this
->
mysqli
()
->
error
);
}
if
(
!
$stmt
=
$this
->
mysqli
()
->
prepare
(
$this
->
_query
))
throw
new
Exception
(
"Problem preparing query (
$this->_query
) "
.
$this
->
mysqli
()
->
error
);
if
(
$this
->
traceEnabled
)
$this
->
traceStartQ
=
microtime
(
true
);
...
...
@@ -1219,11 +1216,10 @@ class MysqliDb
//Reference in the function arguments are required for HHVM to work
//https://github.com/facebook/hhvm/issues/5155
//Referenced data array is required by mysqli since PHP 5.3+
if
(
strnatcmp
(
phpversion
(),
'5.3'
)
>=
0
)
{
if
(
strnatcmp
(
phpversion
(),
'5.3'
)
>=
0
)
{
$refs
=
array
();
foreach
(
$arr
as
$key
=>
$value
)
{
foreach
(
$arr
as
$key
=>
$value
)
$refs
[
$key
]
=
&
$arr
[
$key
];
}
return
$refs
;
}
return
$arr
;
...
...
@@ -1341,9 +1337,8 @@ class MysqliDb
* @param int increment by int or float. 1 by default
*/
public
function
inc
(
$num
=
1
)
{
if
(
!
is_numeric
(
$num
)){
throw
new
Exception
(
'Argument supplied to inc must be a number'
);
}
if
(
!
is_numeric
(
$num
))
throw
new
Exception
(
'Argument supplied to inc must be a number'
);
return
Array
(
"[I]"
=>
"+"
.
$num
);
}
...
...
@@ -1352,9 +1347,8 @@ class MysqliDb
* @param int increment by int or float. 1 by default
*/
public
function
dec
(
$num
=
1
)
{
if
(
!
is_numeric
(
$num
)){
throw
new
Exception
(
'Argument supplied to dec must be a number'
);
}
if
(
!
is_numeric
(
$num
))
throw
new
Exception
(
'Argument supplied to dec must be a number'
);
return
Array
(
"[I]"
=>
"-"
.
$num
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment