I have a site written in PHP with sql code, what is the best way to upgrade my code to sqli? any training or tutorials? how to have clear PHP code?
mysql_connect("localhost","root","");
mysql_select_db("timer");
I have a site written in PHP with sql code, what is the best way to upgrade my code to sqli? any training or tutorials? how to have clear PHP code?
mysql_connect("localhost","root","");
mysql_select_db("timer");
The documentation touches that, to some extent, e.g. here. You can use the same function names, just prefixed with mysqli instead of mysql for the most part, apparently.
From there you should be able to swap out parts of your code with better constructs in mysqli, e.g. parametrised statements instead of manually concatenating SQL.
mysql_connect with mysqli_query, so you have to upgrade all places at once. But apart from that the procedural interface seems to be largely the same.
mysql extension is old, clunky and doesn't support newer features in the server at all. I suspect a large reason why they didn't just improve the mysql extension is backwards compatibility and the large risk of breaking pretty much everything out there.