A few years ago I had to setup a internal webpage for work, one that included connecting to a mysql DB, is did this with this simple code:
<?php
function openDB(){
# first get a mysql connection -
$conn=mysql_connect("127.0.0.1","users","pass") or die("Could not connect to the exceptions server");
$db=mysql_selectdb("db",$conn);
}
function closeDB(){
mysql_close($conn);
}
?>
Now, that server is being decommissioned and it is now running on a new server. After investigating I found that the server is running a newer version of MYSQL (ver 8) and the mysql_connect command had been replaced.
I want to do the exact same thing but not sure what to do, I tried using a few mysqli commands but it keeps failing.
I didn't want to over complicate or re-invent the wheel of this web page, any help would be appreciated in recreating this for mysqli.