I have this piece of code that works fine with php5.6 but it breaks with php7.2. I had three errors and I was able to fix two, I believe :)
$link = mysql_connect($hostname, $username, $password);
if (!$link) {
die('Could not connect !');
exit();
}
else{
mysql_set_charset('utf8',$link);
mysql_select_db($database, $link) or die('Could not select database.');
}
this is what I have so far
$link = mysqli_connect($hostname, $username, $password);
if (!$link) {
die('Could not connect !');
exit();
}
else{
mysqli_set_charset('utf8',$link);
mysqli_select_db($database, $link) or die('Could not select database.');
}
Fatal error with mysql_select_db()
How can I make this function work with php 7.2? any help will be greatly appreciated, thank you in advance!!