I have a problem here with Mysql, it is giving errors, I have made all kinds of changes. I have tried to change the Mysql function to Mysqli and only increase errors.
Code:
<?php
$sql["host"] = "localhost";
$sql["usuario"] = "root";
$sql["senha"] = "arfito";
$sql["base"] = "digify";
$conexao = mysql_connect($sql["host"],$sql["usuario"],$sql["senha"]);
$select_database = mysql_select_db($sql["base"], $conexao);
mysql_query("SET NAMES utf8");
?>
and gives the following error:
Fatal error: Uncaught Error: Call to undefined function mysql_connect () in /var/www/public_html/includes/config.php:6 Stack trace: # 0 /var/www/public_html/index.php (7): include () # 1 {main} thrown in /var/www/public_html/includes/config.php on line 6
When I switch from Mysql to Mysqli it gives the following error:
Warning: mysqli_select_db () expects parameter 1 to be mysqli, string given in /var/www/public_html/includes/config.php on line 7
Warning: mysqli_query () expects at least 2 parameters, 1 given in /var/www/public_html/includes/config.php on line 8
Fatal error: Uncaught Error: Call to undefined function mysql_fetch_array() in /var/www/public_html/index.php:9 Stack trace: #0 {main} thrown in /var/www/public_html/index.php on line 9
Line # 9 of the Index.php code:
$web = mysql_fetch_array(mysql_query("SELECT * FROM settings ORDER BY id DESC LIMIT 1"));