Illegal string offset
Posted: Sat Aug 18, 2012 9:09 am
hi, i´m try to show the register in a formatted table but is getting a error
Illegal string offset
my code is
i get the result of the query and try to display for the user, but is geting this erros, why i should do?
thanks
Illegal string offset
my code is
Code: Select all
$resultado = mysql_fetch_array($query);
echo("<table border='5';text-align:center ");
echo("<thead><tr><th>Chave</th><th>Nome</th><th>Email</th><th>Telefone</th></tr></thead>");
foreach($resultado as $r){
$linhaFormatada = "<tr><td></td><td>%</td><td>%</td><td>%</td></tr>";
printf($linhaFormatada,$r['nome'],$r['email'],$r['telefone']);
}
echo("</table>");
thanks