I'm trying to migrate a Wordpress site. My new host uses PHP7, and there's a plugin that calls @mysql_fetch_array which is a function that has been removed from PHP7.
This is the function call within its control loop:
while( $row = @mysql_fetch_array( $result) ) {
$newSlider = array();
$newSlider['name'] = $row['title'];
$newSlider['value'] = $row['alias'];
$toReturn[] = $newSlider;
}
I did a print_r of the $result Object, and this was the result:
mysqli_result Object
(
[current_field] => 0
[field_count] => 2
[lengths] =>
[num_rows] => 2
[type] => 0
)
Is there a drop-in replacement function for @mysql_fetch_array that works with PHP7?
It appears the $result has been migrated already to use mysqli.
If this is the case, then the function mysqli_fetch_array is a drop in replacement for mysql_fetch_array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With