Welcome Guest, Not a member yet? Register   Sign In
Prepared Queries
#2

Thanks to jreklund,

I made changes to the mysqli drivers on my server.

It would appear that in addition to enabling php-json, php-mysqlnd and php-xml, and ensuring database is MySQL (5.1+) via the MySQLi driver (in my case). I was required to:

use nd_msqli driver instead of the standard mysqli driver which comes installed as standard with my hosting account.

Having updated the driver, the above was NOT an issue when executed properly.

public function registerUser ($data) {

$pQuery = $db->prepare(function($db) {
$sql = "INSERT INTO user_register (salutation, first_name, last_name, telephone, email, password, question, answer, status, level, confirm, ip) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";

return (new Query($db))->setQuery($sql);
});

$results = $pQuery->execute(
$data['salutation'],
$data['first_name'],
$data['last_name'],
$data['telephone'],
$data['email'],
$data['password_hash'],
$data['question'],
$data['answer_hash'],
$data['status'],
$data['level'],
$data['confirm'],
$data['ip']
);

if($results->hasError()) {
return $results->getErrorMessage();
}
Reply


Messages In This Thread
Prepared Queries - by 68thorby68 - 06-08-2020, 07:35 AM
RE: Prepared Queries - by 68thorby68 - 06-16-2020, 07:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB