I am developing a web-site in PHP - MySQL. Here are some points to note:
- I am using MySQLi API for database access.
- In my local installation of XAMPP (a Windows 7 machine), the PHP version is 5.3.8, MySQL version is mysqlnd 5.0.8-dev - 20102224
- I have hosted the web-site on a free hosting server for testing "cuccfree.com". Here the PHP version is 5.3.14 and the MySQL version is 5.1.66. It still has a lot better support for MySQLi compared to many other hosting companies.
- On phpinfo'ing the both, the local machine shows mysqlnd driver installed, but the hosting server has not.
- I have created a wrapper class for MySQLi which fetches the ResultSet using the function mysqli_stmt::get_result(). This function works on my local machine but not on the cuccfree.com hosting server, because the mysqli object does does not have a method named get_result(). Though, the mysqli_stmt object is prepared and bind_param'ed successfully.
- The manual page for mysqli_stmt on php.net says that for using mysqli_stmt::get_result(), we need to have mysqlnd driver installed.
The server's configuration offers the use of mysqli_stmt::bind_object(). But
get_result()
seems to be a much better choice for me, since we can have result in the form of an array. I have overridden the function to accept variable number of arguments using the following line:call_user_func_array(array($stmt, 'bind_param'), $params);
where the $params is an array of parameters.
- Using bind_object(), I have to bind every column returned to a variable. In that case, I cannot create a wrapper class function to handle all SQL queries at a single point.
I looked for several hosting companies, talked and mailed to customer support of many companies, including GoDaddy and Manas Hosting, they do not offer the use of mysqlnd. They, very logically, insist the use of VPS or Dedicated Servers. And obviously, both the suggested options are very costly, even at the entry level.
So, finally to my question, can we installed / embed mysqlnd into a website on a Linux server? If not, what alternative do I have to prevent me from changing the code of entire website, which will take me many-many days?
Regards