Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use mysqli->fetch_all if the PHP version at server is 5.2

Tags:

php

mysqli

I have developed a sample in latest PHP 5.3 and have realized it later that justhost dosn't support mysqlnd and PHP 5.3 so I have to change my db class method which are using mysqli->fetch_all() .

Does any one know a way to save this effort? Maybe another way arround by using a plugin or middle layer or some thing I can switch or test if mysqlnd is supported at the server or not ?

like image 561
Khurram Ijaz Avatar asked Jan 24 '26 18:01

Khurram Ijaz


1 Answers

I would suggest going forward with a database layer like PDO or Zend_Db. Just choose one that you prefer.

Now as far as fixing all your existing code:

  1. Most IDE's have some sort of find replace function that can work over multiple files.
  2. If you are using OSX/Linux you may want to look at some command line tools like sed to replace the code in your existing files. Might be a bit of a learning curve on that though.
like image 111
datasage Avatar answered Jan 27 '26 06:01

datasage



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!