Based on this code below I use for regular mysql, how could I convert it to use mysqli?
Is it as simple as changing mysql_query($sql);
to
I've created a tool called Rector, that handles instant upgrades. There is also mysql → mysqli set.
It handles:
non-1:1 function calls changes, e.g.
$data = mysql_db_name($result, $row);
↓
mysqli_data_seek($result, $row);
$fetch = mysql_fetch_row($result);
$data = $fetch[0];
Just use it on your code:
composer require rector/rector --dev
vendor/bin/rector process src --set mysql-to-mysqli
I've already run it on 2 big PHP projects and it works perfectly.