mysqlnd Driver for PHP

Status
Not open for further replies.

xsecurit

New Member
Messages
4
Reaction score
0
Points
1
Hi,

Today when i upload a test website to host, i got this problem for login example when using OOP in PHP: Call to undefined method mysqli_stmt::get_result()
The error mean mysqlnd Driver was not installed or enable in server.
So i would like to know does free host support for mysqlnd Driver and if yes so how to make it work?

Thanks in advance!
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,818
Reaction score
163
Points
63
Code:
root@absolut [~]# php -i | grep mysqlnd
mysqlnd
mysqlnd => enabled
Version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
Loaded plugins => mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password
mysqlnd statistics =>
Client API version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $

mysqlnd is enabled on the server... this is a script issue and not an issue with the server.. therefore, you will need to post some code for someone to help you.
 

xsecurit

New Member
Messages
4
Reaction score
0
Points
1
mysqlnd is enabled on the server... this is a script issue and not an issue with the server.. therefore, you will need to post some code for someone to help you.

My script works well on my localhost.

Please take a look below:
Code:
<?php
session_start();

$iptUsername=$_POST['iptUsername'];
$iptPwd=$_POST['iptPwd'];
if ( !$iptUsername || !$iptPwd) {
    header("Location:../index.php");
}
require("../dbscript/config.php");
$conn = new mysqli($host, $username, $password, $db);
if($conn->connect_error > 0){
    die('Unable to connect to database [' . $db->connect_error . ']');
}


// mysql prepared statement
$prepareQuery = "SELECT USERNAME FROM tbluser WHERE USERNAME=? AND PASSWORD=? LIMIT 1";
$stmt = $conn->stmt_init();
$stmt->prepare($prepareQuery);
$stmt->bind_param("ss", $iptUsername, $iptPwd);
$stmt->execute();

$result = $stmt->get_result();
$total = $result->num_rows;

// close connection
$stmt->close();
$conn->close();

if ($total > 0) {
    header("Location:../admin/index.php");
} else {
    $_SESSION['errorMsg'] = "Invalid username or password, please try again!";
    header("Location:../index.php");
}
?>
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,818
Reaction score
163
Points
63
I just dug into this a bit and it looks like the mysqli extension for mysqlnd isn't installed.. I'm talking with our administrators about this. Might be patched in the 5.5 update
 

xsecurit

New Member
Messages
4
Reaction score
0
Points
1
I just dug into this a bit and it looks like the mysqli extension for mysqlnd isn't installed.. I'm talking with our administrators about this. Might be patched in the 5.5 update

When do you apply that patch? And i would like to know where can i see the version to know the patch was installed?

Thanks in advance!
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,818
Reaction score
163
Points
63
I'm not sure, but we'll be upgrading to PHP 5.5 soon. It was scheduled for wednesday, but we ran into some issues.
 
Status
Not open for further replies.
Top