0
I’m new to PHP
and I am currently studying PDO
, made a simple structure and has an error that I cannot identify. I have seen several examples of people using the same structure and it works.
<?php
$host = "localhost";
$user = "root";
$pass = "";
$dbname = "test";
$conexao = mysqli_connect($host, $user, $pass);
$db = mysql_select_db($conexao, $dbname);
$nome = "exemplo";
$consulta = mysql_query("SELECT * FROM usuarios_teste WHERE nome = $nome ");
?>
The mistakes I get are:
Fatal error: Uncaught Error: Call to Undefined Function mysql_select_db()
Error: Call to Undefined Function mysql_select_db()
The functions
mysql_
no longer exist in php7, you must use mysqli_– rray
I tried to find something like "mysqli_select_db" in the php manual and did not find, I found that this specific function had not changed, thanks
– The_Kevin
If you are studying PDO I would advise you to take a look at this: http://php.net/manual/book.pdo.php
– Jorge B.