I'm trying to make a connection via php to a mysql server but it always has the following error:
Warning: mysql_select_db () expects parameter 2 to be resource, null given in /home/u517649386/public_html/conecta.php on line 6
The code used is as follows:
<?php
$banco = new PDO('mysql:host=mysql.hostinger.com.br;u517649386_teste', 'u517649386_teste','senha')or die(mysql_error());
print "Conexão efetuada com sucesso!";
mysql_select_db('u517649386_teste', $con);
print "Conexão e Seleção OK!";
if($_GET['acao'] == 'listapizzas'){
$sql = "SELECT * FROM 'pizzas' LIMIT 0, 30 ";
$re = mysql_query($SQL, $serve);
$num = mysql_num_rows($re);
if($num > 0){
while($Linha = mysql_fetch_object($re)){
echo "{$Linha->Nome}<br />";
}
}
else{
echo 'nenhuma pizza cadastrada';
}
}
?>
The php version of the server is 5.5.35