2

My prepared statements work just fine in MAMP with PHP 5.4 and no need to tweak php.ini. On my GoDaddy site, the same code fails with:

Fatal error: Call to undefined function mysqli_stmt_get_result().

My GoDaddy info.php shows the following as enabled:

mysqli Client API library version 5.5.45

mysqlnd: mysqlnd 5.0.10
Loadedplugins:mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password
API Extensions: none

GoDaddy says their PHP is working just fine, although I doubt they tested for this function. They claim it must be a code error, which strikes me as inconsistent with both, the nature of the error and the fact the code works in MAMP.

What's my next step?

Community
  • 1
  • 1
Frank A.
  • 51
  • 7
  • You're sure MySQLND is installed? Is the Godaddy server Linux? – Machavity Apr 26 '16 at 19:54
  • @Machavity He showed the `phpinfo()` output. – Barmar Apr 26 '16 at 19:55
  • @Barmar I know, but I've seen some crazy installs where it will list MySQLND but not use it. Just trying to rule that out – Machavity Apr 26 '16 at 20:18
  • Do you have any suggestion for how he should determine whether it's installed, other than the output of phpinfo? – Barmar Apr 26 '16 at 20:20
  • All I have is the phpinfo output. Inside my cPanel account is a page where I can select a number of options and mysql, mysqli and mysqlnd are pre-selected. Could the Client API library version have preference; I'm not sure there's a way for me to turn it off. Yes, it's Linux. – Frank A. Apr 26 '16 at 22:53
  • Would it help if I showed the query, It's pretty standard and, as I say, it works fine in MAMP. – Frank A. Apr 26 '16 at 23:00
  • The only difference between the MAMP phpinfo and the GoDaddy phpinfo is under mysqlnd API Extensions where GoDaddy has none and MAMP has mysqli,pdo_mysql,mysql – Frank A. Apr 26 '16 at 23:05
  • So it's a problem. – Your Common Sense Apr 27 '16 at 04:10
  • The problem exists not only on my site but also a client's site on GoDaddy and, I now discover, on a second client's site on a different host. I will abandon this approach and use mysqli_stmt_bind_result() and mysqli_stmt_fetch(). Less convenient for updating code but more certain of results and I don't have to negotiate with server hosts. – Frank A. May 01 '16 at 23:59

2 Answers2

6

Enable nd_mysqli in php extensions and disable mysqli

Carlos Rangel
  • 91
  • 2
  • 3
1

Go to control panel of go daddy Then select php and then select nd_mysqli and save

It must work under any circumstances

Partap
  • 181
  • 1
  • 9