DarthSidus wrote:How can I adapt my php script and use mysqli_xxxx bearing in mind im a newbie
There are two options:
a) either edit all your scripts and replace all mysql_xxxx by the corresponding mysqli_xxxx call. CAUTION: the parameter of the functions are NOT identical mysql/mysqli, get you the documentation about mysqli and replace all functions carefully
b) do NOT edit all your script by replacing all mysql_xxxx calls, instead create a single PHP script which declares and rebuilds all mysql_xxx functions via mysqli_xxxx functions. For example:
- Code: Select all
<?php
function mysql_connect ($server, $username, $password) {
return mysqli_connect($server, $username, $password);
}
function mysql_xxxx ....
....
...
?>
Finally include this script into all your PHP scripts which handle with mysql_xxxx functions. This second solution is kind of "quick&dirty", it is better to replace all mysql_xxxx directly via mysqli_xxxx and eventually to adapt the parameters for the corresponding call. This is unfortunately not an easy job for a beginner.
Last not least you may of course go back to PHP 5, probably easier for a newbie.