Jump to content
Fórum Script Brasil
  • 0

Ajuda em Codigo PHP


andreia_sampa

Question

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);

?>

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...