Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

PHP + mysql

$
0
0
tou a tentar fazer uma simples ligação À BD para conseguir imprimir os dados da tabela mas dá-me sempre o seguinte warning

Warning: mysql_fetch_array() expects parameter 1 to be resource, object given in



o meu código está assim:

Código :
<?php
$link = mysqli_connect('localhost', 'root', '');
if (!$link) {
die('Not connected : ' . mysql_error());
}
else{echo"ligado";}

$db = mysqli_select_db($link,'top');
$sql = "SELECT * FROM jogadores";
$res = mysqli_query($link,$sql);
while ($row = mysql_fetch_array($res)){}

?>

Viewing all articles
Browse latest Browse all 14700