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
a392b4f6
Commit
a392b4f6
authored
Oct 23, 2010
by
Josh Campbell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added rawQuery Method
parent
51653d48
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
350 deletions
+30
-350
MysqlDb.php
MysqlDb.php
+0
-350
MysqliDb.php
MysqliDb.php
+30
-0
No files found.
MysqlDb.php
deleted
100644 → 0
View file @
51653d48
This diff is collapsed.
Click to expand it.
MysqliDb.php
View file @
a392b4f6
...
...
@@ -49,6 +49,36 @@ class MysqliDB {
unset
(
$this
->
_whereTypeList
);
unset
(
$this
->
_paramTypeList
);
}
/**
*
* @param string $query Contains a user-provided query.
* @param array $bindData All variables to bind to the SQL statment.
* @return array Contains the returned rows from the query.
*/
public
function
rawQuery
(
$query
,
$bindParams
=
NULL
)
{
$this
->
_query
=
filter_var
(
$query
,
FILTER_SANITIZE_STRING
);
$stmt
=
$this
->
_prepareQuery
();
if
(
gettype
(
$bindParams
)
===
'array'
)
{
$params
=
array
(
''
);
foreach
(
$bindParams
as
$prop
=>
$val
)
{
$params
[
0
]
.=
$this
->
_determineType
(
$val
);
array_push
(
$params
,
&
$bindParams
[
$prop
]);
}
call_user_func_array
(
array
(
$stmt
,
'bind_param'
),
$params
);
}
$stmt
->
execute
();
$this
->
reset
();
$results
=
$this
->
_dynamicBindResults
(
$stmt
);
return
$results
;
}
/**
*
...
...
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