0
I’m getting an error when connecting to database
Php code:
<?php
$siteA = 'http://www.'.$_SERVER['SERVER_NAME'].'/';
$siteB = '/';
$email_suporte_staff = '[email protected]';
global $siteB;
global $siteA;
$config_bd = array(
'host' => 'meuhost',
'db' => 'database',
'usuario' => 'databaseuser',
'senha' => 'password',
);
error_reporting (E_ALL & ~ E_NOTICE & ~ E_DEPRECATED);
$conect = mysql_connect($config_bd['host'], $config_bd['usuario'], $config_bd['senha']);
if($conect)
{
mysql_select_db($config_bd['db']);
mysql_set_charset('utf8');
}
else
{
echo '<center><b>config/config.php</b> nao configurado.</center>';
exit;
}
?>
Ask the error message. And start studying the functions
mysqlior PDO. The functionsmysqlare already obsolete and have been removed from PHP 7.– Woss
vlw when you mentioned about Php 7 I remembered that the script was done in 5 ai I installed it and it worked
– Barry Allen