It's difficult to convert the in mysqli I am using MySQLi server for connectivity so what the best way to convert this mysql to mysqli
The first thing to do would probably be to replace every mysql_* function call with its equivalent mysqli_*, at least if you are willing to use the procedural API -- which would be the easier way, considering you already have some code based on the MySQL API, which is a procedural one For  instance: mysql_connect will be replaced by mysqli_connect