>
Boa noite se alguém poder me ajudar não estou conseguindo fazer a conexão com a base de dados apresenta este erro:
Link do erro: http://rlsystem.com.br/forum/disco/uploads/7e7ac36f4fd1ecd8f78d965193b2db8c-teste.jpg
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\WebPHP\conexao.php on line 7
Meu código
$server = "localhost";
$user = "root";
$password = "1993";
$dbName = "sistema";
$conn = mysql_connect($server, $user, $password);
$db = mysql_select_db($dbName, $conn);
if(!$conn){
echo "erro ao conectar";
}
?>
Ola Ian
utilize esses comandos aqui
$db = new PDO('mysql:host=localhost;dbname=testdb;charset=utf8', 'username', 'password');
$result = $db->exec("INSERT INTO table(firstname, lastname) VAULES('John', 'Doe')");
$insertId = $db->lastInsertId();
?>
ou esse aqui
$db = new mysqli($DBServer, $DBUser, $DBPass, $DBName);
$result = $db->query("INSERT INTO table(firstname, lastname) VAULES('John', 'Doe')");
Estou tendo o mesmo tipo de problema, meu banco dá erro e não conecta, quando abro o listar aparece o seguinte erro:
Warning: include(conexao.php;): failed to open stream: No such file or directory in C:\wamp\www\OsPHP\listar.php on line 3
Warning: include(): Failed opening 'conexao.php;' for inclusion (include_path='.;C:\php\pear') in C:\wamp\www\OsPHP\listar.php on line 3
Tudo tinha funcionado corretamente...
Olá
Seu arquivo conexao.php deve estar no mesmo diretorio deste arquivo.