Jump to content


Photo

Erro Pagina Php (Mais.Php)


  • Faça o login para participar
1 reply to this topic

#1 alexweb13

alexweb13

    Novato no fórum

  • Usuários
  • 1 posts
  • Sexo:Masculino
  • Localidade:cidreira-rs

Posted 27/10/2011, 10:18

Attached File  mais.php   4.98KB   3 downloadsOlá companheiros abaixo o código com erro no mais.php de uma pagina de carros
espero que esta duvida me ajude a ajude outras pessoas, estou estudando php iniciante, em breve espero esta ajudando neste forum e construindo projetos

forte abraço
<?
@INCLUDE ("includes/barracima.php");
@INCLUDE ("includes/config.php");
@INCLUDE ("includes/abrebanco.php");

$info = $numero;
$sql_mais = "select * from automoveis where id='$info'";
$exe_mais = mysql_query($sql_mais);
$mais = mysql_result($exe_mais,0,"marca");
$mais2 = mysql_result($exe_mais,0,"modelo");
$mais3 = mysql_result($exe_mais,0,"categoria");
$mais4 = mysql_result($exe_mais,0,"tipo");

$sql_marca = "select * from marcas where id='$mais'";
$exe_marca = mysql_query($sql_marca);

$sql_mod = "select * from modelos where id='$mais2'";
$exe_mod = mysql_query($sql_mod);

$sql_categ = "select * from categorias where id='$mais3'";
$exe_categ = mysql_query($sql_categ);

$sql_tipo = "select * from tipos where id='$mais4'";
$exe_tipo = mysql_query($sql_tipo);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="150" valign="top">
<?
include ("includes/barraesq.php");
?>
</td>
<td height="100%" valign="top"> <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>

<td height="100%" align="center" valign="top" bgcolor="#FFFFFF"> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><img src="imagens/tit_adm_autos.gif" width="456" height="27"></td>
</tr>
</table>
<br>
<?=$fonte02?>
<b>Mais informa&ccedil;&otilde;es sobre o autom&oacute;vel</b><br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$foto = mysql_result($exe_mais,0,"foto");
if ($foto != ""){
?>
<tr><td width="0%">&nbsp;</td>
<td colspan='2' align='center' bgcolor='#DBDBDB'><img src="<?=$foto?>" width="300" border="1" bordercolor="<?=$table?>"></td>
<td width="1%">&nbsp;</td></tr>
<?
}
?>
<tr>
<td width="0%">&nbsp;</td>
<td width="21%" bgcolor="#EDEDED"><?=$fonte02?>
&nbsp;<b>Marca:</b></td>
<td width="78%" bgcolor="#EDEDED"> <?=$fonte02?> <?=mysql_result($exe_marca,0,"marca")?> </td>
<td width="1%">&nbsp;</td>
</tr>
<tr>
<td width="0%">&nbsp;</td>
<td width="21%" bgcolor="#DBDBDB"><?=$fonte02?> &nbsp;<b>Modelo:</b></td>
<td width="78%" bgcolor="#DBDBDB"> <?=$fonte02?> <?=mysql_result($exe_mod,0,"modelo")?> </td>
<td width="1%">&nbsp;</td>
</tr>
<tr>
<td width="0%">&nbsp;</td>
<td width="21%" bgcolor="#EDEDED"><?=$fonte02?> &nbsp;<b>Ano:</b></td>
<td width="78%" bgcolor="#EDEDED"> <?=$fonte02?> <?=mysql_result($exe_mais,0,"ano")?> </td>
<td width="1%">&nbsp;</td>
</tr>
<tr>
<td width="0%">&nbsp;</td>
<td width="21%" bgcolor="#DBDBDB"><?=$fonte02?> &nbsp;<b>Cor:</b></td>
<td width="78%" bgcolor="#DBDBDB"> <?=$fonte02?> <?=mysql_result($exe_mais,0,"cor")?> </td>
<td width="1%">&nbsp;</td>
</tr>
<tr>
<td width="0%">&nbsp;</td>
<td width="21%" bgcolor="#EDEDED"> <?=$fonte02?> &nbsp;<b>Pre&ccedil;o:</b></td>
<td width="78%" bgcolor="#EDEDED"> <?=$fonte02?> <?=mysql_result($exe_mais,0,"preco")?> </td>
<td width="1%">&nbsp;</td>
</tr>
<tr>
<td width="0%">&nbsp;</td>
<td width="21%" bgcolor="#DBDBDB"> <?=$fonte02?> &nbsp;<b>Descri&ccedil;&atilde;o:</b></td>
<td width="78%" bgcolor="#DBDBDB"> <?=$fonte02?> <?=mysql_result($exe_mais,0,"descricao")?> </td>
<td width="1%">&nbsp;</td>
</tr>
<tr>
<td width="0%">&nbsp;</td>
<td width="21%" bgcolor="#EDEDED"> <?=$fonte02?> &nbsp;<b>Categoria:</b></td>
<td width="78%" bgcolor="#EDEDED"> <?=$fonte02?> <?=mysql_result($exe_categ,0,"categoria")?> </td>
<td width="1%">&nbsp;</td>
</tr>
<tr>
<td width="0%">&nbsp;</td>
<td width="21%" bgcolor="#DBDBDB"> <?=$fonte02?> &nbsp;<b>Tipo:</b></td>
<td width="78%" bgcolor="#DBDBDB"> <?=$fonte02?> <?=mysql_result($exe_tipo,0,"tipo")?> </td>
<td width="1%">&nbsp;</td>
</tr>
</table>
<br>
<?=$fonte02?>
<a href="javascript:history.back(1)"><b>voltar<br>
<br></b></a></td>
</tr>
</table></td>
<td width="152" valign="top" background="imagens/fundo_barra_dir.gif">
<?
@include ("includes/barradir.php");
?></td>
</tr>
</table>
<?
@INCLUDE ("includes/rodape.php");
?>

#2 Diego Bezerra

Diego Bezerra

    Diego Bezerra

  • Moderadores
  • 938 posts
  • Sexo:Masculino
  • Localidade:Amazonas
  • Interesses:Iniciando no C# com MSSQL.

Posted 27/10/2011, 15:59

Opa olha seu codigo esta meio fora do que eu posso dizer php5...
me manda por msg a estrutura da base de dados que eu te faço um exemplo...

fala ai olha eu fiquei muito corrido ultimamentel naum tou tendo muito tempo para te ajudar... mais tenta pesquisar sobre o while
http://us3.php.net/m...tures.while.php

mais tenta fazer estas modificações abaixo
<?php
  @INCLUDE ("includes/barracima.php");
  @INCLUDE ("includes/config.php");
  @INCLUDE ("includes/abrebanco.php");
  
  //eu uso assim
  //include ("includes/barracima.php");
  //include ("includes/config.php");
  //include ("includes/abrebanco.php");

$info = $numero;
$sql_mais = "select * from automoveis where id='$info'";
$exe_mais = mysql_query($sql_mais);
$mais = mysql_result($exe_mais,0,"marca");
$mais2 = mysql_result($exe_mais,0,"modelo");
$mais3 = mysql_result($exe_mais,0,"categoria");
$mais4 = mysql_result($exe_mais,0,"tipo");

$exe_marca =  mysql_query("select * from marcas where id='$mais'");
$exe_mod = mysql_query("select * from modelos where id='$mais2'");
$exe_categ = mysql_query("select * from categorias where id='$mais3'");
$exe_tipo = mysql_query("select * from tipos where id='$mais4'");
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td width="150" valign="top"> 
<?
  include ("includes/barraesq.php");
?>
    </td>
    <td height="100%" valign="top"> <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          
      <td height="100%" align="center" valign="top" bgcolor="#FFFFFF"> <br>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td align="center"><img src="imagens/tit_adm_autos.gif" width="456" height="27"></td>
              </tr>
            </table>
            <br>
            <?=$fonte02?>
            <b>Mais informa&ccedil;&otilde;es sobre o autom&oacute;vel</b><br>
            <br>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
  $foto = mysql_result($exe_mais,0,"foto");                       
  if ($foto != ""){
?>
			  	 <tr><td width="0%">&nbsp;</td>
                 <td colspan='2' align='center' bgcolor='#DBDBDB'><img src="<?=$foto?>" width="300" border="1" bordercolor="<?=$table?>"></td>
				 <td width="1%">&nbsp;</td></tr>
<?
  }
?>
              <tr> 
                <td width="0%">&nbsp;</td>
                <td width="21%" bgcolor="#EDEDED"><?=$fonte02?>
                  &nbsp;<b>Marca:</b></td>
                <td width="78%" bgcolor="#EDEDED"> <?=$fonte02?> <?php echo mysql_result($exe_marca,0,"marca")?> </td>
                <td width="1%">&nbsp;</td>
              </tr>
              <tr> 
                <td width="0%">&nbsp;</td>
                <td width="21%" bgcolor="#DBDBDB"><?=$fonte02?> &nbsp;<b>Modelo:</b></td>
                <td width="78%" bgcolor="#DBDBDB"> <?=$fonte02?> <?php echo mysql_result($exe_mod,0,"modelo")?> </td>
                <td width="1%">&nbsp;</td>
              </tr>
              <tr> 
                <td width="0%">&nbsp;</td>
                <td width="21%" bgcolor="#EDEDED"><?=$fonte02?> &nbsp;<b>Ano:</b></td>
                <td width="78%" bgcolor="#EDEDED"> <?=$fonte02?> <?php echo mysql_result($exe_mais,0,"ano")?> </td>
                <td width="1%">&nbsp;</td>
              </tr>
              <tr> 
                <td width="0%">&nbsp;</td>
                <td width="21%" bgcolor="#DBDBDB"><?=$fonte02?> &nbsp;<b>Cor:</b></td>
                <td width="78%" bgcolor="#DBDBDB"> <?=$fonte02?> <?php echo mysql_result($exe_mais,0,"cor")?> </td>
                <td width="1%">&nbsp;</td>
              </tr>
              <tr> 
                <td width="0%">&nbsp;</td>
                <td width="21%" bgcolor="#EDEDED"> <?=$fonte02?> &nbsp;<b>Pre&ccedil;o:</b></td>
                <td width="78%" bgcolor="#EDEDED"> <?=$fonte02?> <?php echo mysql_result($exe_mais,0,"preco")?> </td>
                <td width="1%">&nbsp;</td>
              </tr>
              <tr> 
                <td width="0%">&nbsp;</td>
                <td width="21%" bgcolor="#DBDBDB"> <?=$fonte02?> &nbsp;<b>Descri&ccedil;&atilde;o:</b></td>
                <td width="78%" bgcolor="#DBDBDB"> <?=$fonte02?> <?php echo mysql_result($exe_mais,0,"descricao")?> </td>
                <td width="1%">&nbsp;</td>
              </tr>
              <tr> 
                <td width="0%">&nbsp;</td>
                <td width="21%" bgcolor="#EDEDED"> <?=$fonte02?> &nbsp;<b>Categoria:</b></td>
                <td width="78%" bgcolor="#EDEDED"> <?=$fonte02?> <?php echo mysql_result($exe_categ,0,"categoria")?> </td>
                <td width="1%">&nbsp;</td>
              </tr>
              <tr>
                <td width="0%">&nbsp;</td>
                <td width="21%" bgcolor="#DBDBDB"> <?=$fonte02?> &nbsp;<b>Tipo:</b></td>
                <td width="78%" bgcolor="#DBDBDB"> <?=$fonte02?> <?php echo mysql_result($exe_tipo,0,"tipo")?> </td>
                <td width="1%">&nbsp;</td>
              </tr>
            </table>
            <br>
            <?=$fonte02?>
            <a href="javascript:history.back(1)"><b>voltar<br>
            <br></b></a></td>
        </tr>
      </table></td>
    <td width="152" valign="top" background="imagens/fundo_barra_dir.gif">
<?
  @include ("includes/barradir.php");
?></td>
  </tr>
</table>
<?
  @INCLUDE ("includes/rodape.php");
?>

Att.
Diego Bezerra
Agência Kernel - em Breve
Email/msn: diegobezerra@outlook.com
Facebook




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq