I am developing a website in PHP - MySQL. Here are a few notes:
- I am using the MySQLi API to access the database.
- In my local installation of XAMPP (Windows 7 machine) PHP version 5.3.8 , MySQL version mysqlnd 5.0.8-dev - 20102224
- I hosted the website on a free hosting server for testing "cuccfree.com". Here is PHP version 5.3.14 and MySQL version 5.1.66 . It still supports MySQLi much better than many other hosting companies.
- In phpinfo'ing of both, the local machine shows the mysqlnd driver, but the hosting server does not.
- I created a wrapper class for MySQLi that retrieves a ResultSet using the mysqli_stmt :: get_result () function. This function works on my local machine, but not on the cuccfree.com hosting server, because the mysqli object does not have a method named get_result () . Although, the mysqli_stmt object is prepared and bind_param'ed is successful.
- The mysqli_stmt man page on php.net says that to use mysqli_stmt :: get_result () , we need to install mysqlnd .
Server configuration suggests using mysqli_stmt :: bind_object () . But get_result() seems to me a much better choice, since we can get the result as an array. I redefined the function to accept a variable number of arguments using the following line:
call_user_func_array (array ($ stmt, 'bind_param'), $ params);
where $ params is an array of parameters.
- Using bind_object (), I have to bind each column returned to a variable. In this case, I cannot create a wrapper class function to process all SQL queries at one point.
I looked for several hosting companies, talked and sent letters to the support service of many companies, including GoDaddy and Manas Hosting, they do not suggest using mysqlnd . They, very logically, insist on using VPS or dedicated servers. And, obviously, both of the proposed options are very expensive, even at the initial level.
So finally, to my question, can we install / deploy mysqlnd into a website on a Linux server? If not, what alternative should I stop me from changing the code for the whole website, which will take me many, many days?
Hello
source share