aula 43 curso php, html e css
06/10/2015
0
Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\Program Files\VertrigoServ\www\siteweb\home.php on line 68
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, object given in C:\Program Files\VertrigoServ\www\siteweb\home.php on line 70
o codigo abaixo
<?php
$sql = 'select * from clientes';
$query = mysqli_query($sql);
while ($resultado = mysqli_fetch_array($banco,$query)) {
print "
<tr>
<td> $resultado[nome]</td>
<td> $resultado[endereco]</td>
<td> $resultado[cidade]</td>
<td> $resultado[bairro]</td>
<td> $resultado[cep]</td>
<td> $resultado[email]</td>
</tr>
";
}
?>
CONEXAO DO BANCO
<?php
$host= 'localhost';
$usuario= 'root';
$senha = 'vertrigo';
$banco = mysqli_connect($host,$usuario,$senha) or die ("Não foi possivel Conectar no Servidor!");
mysqli_select_db($banco, 'aulaphp') or die ("Não foi possivel encontrar o banco de Dados");
?>
Pedro Antonio
Posts
06/10/2015
Pedro Antonio
06/10/2015
Marcio Araujo
[url]http://php.net/manual/pt_BR/ref.mysqli.php[/url]
Clique aqui para fazer login e interagir na Comunidade :)