Fatal error: Call to undefined method mysqli_stmt::get_result() [duplicate]
Asked Answered
N

2

6

Since i've moved a site of mine to a new vServer, I always get this error message

Fatal error:  Call to undefined method mysqli_stmt::get_result()

These lines of code are working fine

$mysql = new mysqli($db_host, $db_user, $db_password, $db_database);
$partys = NULL;
$res_partys = $mysql->query("SELECT * FROM party ORDER BY begin");
while($row_partys = $res_partys->fetch_array()) {
    $partys[] = $row_partys;
}
$count_reg = $mysql->prepare("SELECT COUNT(*) FROM guestlist WHERE partyid = ?");
$count_reg->bind_param('i', $party['partyid']);
$count_reg->execute();

but $count_res = $count_reg->get_result(); fails. Mysqli support is enabled.

Accorind to some internet sources I need the PHP MySQL native drivers, but I've only got php5-mysql installed on my Debian 7 machine, as installing php5-mysqlnd via apt-get install php5-mysqlnd would automatically remove Froxlor, which is my server management panel.

Are there other ways to install mysqlnd except downloading it via apt-get download php5-mysqlnd and installing it using dpkg, as this would throw errors on each following apt-get call due to unmet requirements, and compiling PHP including mysqlnd from source?

Nikaniki answered 19/1, 2014 at 22:0 Comment(2)
which version of PHP are you on? get_result() was added in 5.3.0Sundown
I'm running PHP 5.4.4Inconformity
N
5

I've managed installing php5-mysqlnd without removing Froxlor.

Froxlor has an dependecy on php5-mysql, which is removed by installing php5-mysqlnd, but is also compatible to mysqlnd.

So I had to download the package via apt-get download php5-mysqlnd and install it using dpkg -i --ignore-depends=froxlor php5-mysqlnd_5.4.4-14+deb7u7_amd64.deb

Nikaniki answered 20/1, 2014 at 16:57 Comment(0)
M
0

Your server doesnot have mysql native drivers (mysqlnd).

Install this extension in your server to use get result function.

Medicaid answered 19/1, 2014 at 22:1 Comment(1)
That's just what I've already written in my question. My problem is that installing mysqlnd via apt-get install php5-mysqlnd would remove Froxlor, my server management panelInconformity

© 2022 - 2024 — McMap. All rights reserved.