NESCent / FossilCalibrations

Fossil calibrations database
http://fossilcalibrations.org
BSD 2-Clause "Simplified" License
14 stars 4 forks source link

Rewrite queries to avoid mysqli_stmt_get_result and mysqlnd #74

Closed dleehr closed 9 years ago

dleehr commented 9 years ago

During discussions with Mark Sutton trying to get FCDB up and running we encountered some issues with mysqli_stmt_get_result, reminiscent of #53

[Fri Jan 16 21:04:36 2015] [warn] [client 152.3.68.115] mod_fcgid: stderr: PHP Fatal error: Call to undefined function mysqli_stmt_get_result() in fetch-search-results.php on line 152

Their web hosting environment (Plesk) has issues with php-mysqlnd:

A quick googling suggests that there are known problems with installing php-mysqlnd under Plesk. Plesk 11 at least is apparently not compatible with it (i.e. installing it breaks Plesk). We are on Plesk 12, but there seems to be no information about whether or not this compatibility issue has been fixed. I'm really not keen to try if we can possibly avoid it.

Other notes (from Alan Spencer):

No never looked into it in any real detail as php-mysqlnd module does not come installed as standard when used in conjunction with Plesk and there are other way of connecting to a MySQL server and doing prepared statements (e.g. PDO,...). I'd be very wary of installing it as it could break the Plesk-mysql password authentication which would cause all sorts of issues and possibly result in another full server reinstall.

The alternative is to use mysqli_stmt_bind_result with variable bindings.

php-mysqlnd will not be installed on the host, so we must rewrite the code that uses mysqli_stmt_get_result to use a different function.

kcranston commented 9 years ago

Ping to @jimallman via email (and also, I suppose, with notification on this issue).

jimallman commented 9 years ago

OK, the latest code (as of 28d6fb44cc4564148891f6c368990b1dcf0887fd) should no longer require mysqlnd. Please test on the PalAss server and update this issue.

kcranston commented 9 years ago

Thanks, Jim! I'll get Mark to give this a try. More soon.

On Sun, Jan 25, 2015, 23:29 Jim Allman notifications@github.com wrote:

OK, the latest code (as of 28d6fb4 https://github.com/NESCent/FossilCalibrations/commit/28d6fb44cc4564148891f6c368990b1dcf0887fd) should no longer require mysqlnd. Please test on the PalAss server and update this issue.

— Reply to this email directly or view it on GitHub https://github.com/NESCent/FossilCalibrations/issues/74#issuecomment-71413705 .

dleehr commented 9 years ago

Code no longer uses mysqli_stmt_get_result, closing.