Ir para conteúdo
Fórum Script Brasil

andreia_sampa

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Tudo que andreia_sampa postou

  1. Oi me ajudem aki nessse codigo?? O q ta errado??!! Obrgdas <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Série Faca um Site - PHP 5 com MySQL</title> </head> <?PHP include "estilo1.inc"; include "dbConexao.php"; $sql = "SELECT categoria.cat_nome, miniaturas.* "; $sql = $sql . " FROM categorias "; $sql = $sql . " INNER JOIN miniaturas "; $sql = $sql . " ON categorias.id = miniaturas.id_categoria "; $sql = $sql . " WHERE categorias.cat_nome = 'Aviões'"; $rs = mysql_query($sql, $conexao); $total_registros = mysql_num_rows($rs); ?> <body> <p>Sentenca SQL desse laboratorio:<strong><?PHP print $sql; ?></ strong><br /> Total de registros retornados pela consulta: <strong><?PHP print $total_registros; ?></strong></p> <table cellspacing="0"> <thead> <tr> <td>Nome</td> <td>Cat </td> <td>Cor</td> <td align="right">Preço</td> </tr> </thead> <?PHP while ($reg = mysql_fetch_array($rs)) { $nome = $reg["nome"]; $cor = $reg["cor"]; $id_categoria = $reg["cat_nome"]; $preço = $reg["preço"]; ?> <tr> <td><?PHP print $nome; ?></td> <td><?PHP print $cor; ?></td> <td><?PHP print $id_categoria; ?></td> <td align="right">R$ <?PHP print number_format($preço,2,',','.'); ?></td> </tr> <?PHP } ?> <table> </body> </html> <?PHP mysql_free_result($rs); mysql_close($conexao); ?>
×
×
  • Criar Novo...