
ianclever
(usa Arch Linux)
Enviado em 14/04/2014 - 01:09h
era erro de sintaxe no mysql_query o nome da tabela devai estar entre apostofos pq contem numero, ficou assim:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="estilo.css"/>
<title>Listar</title>
</head>
<body>
<table>
<tr>
<td class='col1'>Nome</td>
<td class='col2'>CPF</td>
<td class='col3'>Telefone</td>
<td class='col4'>Celular</td>
<td class='col5'>E-mail</td>
</tr>
<?php
$conexao = mysql_connect("localhost","root","senha");
$db = mysql_select_db("teste");
$tabela = mysql_query("SELECT * FROM `tabela1`");
while($linha = mysql_fetch_array($tabela))
{
echo "<tr> <td class='col1'>".$linha["nome"]."</td>
<td class='col2'>".$linha["cpf"]."</td>
<td class='col3'>".$linha["telefone"]."</td>
<td class='col4'>".$linha["celular"]."</td>
<td class='col5'>".$linha["email"]."</td>
</tr>";
}
mysql_close();
?>
</table>
<button id="v"onclick="document.location='index.html'">Voltar</button>
</body>
</html>