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
mysql_query($sql);
(I realise this is old, but it still comes up...)
If you do replace mysql_* with mysqli_* then bear in mind that a whole load of mysqli_* functions need the database link to be passed.
mysql_*
mysqli_*
E.g.:
mysql_query($query)
becomes
mysqli_query($link, $query)
I.e., lots of checking required.