Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Encontrei problemas num página php que estava programando para "Editar" ou "Excluir" dados do Servidor mysql. Fiz tudo me baseando num tutorial, video-aula, fiz tudo certo. No video, do ano de 2008, deu certo. no meu apareceu esse erro:
/applications/core/interface/imageproxy/imageproxy.php?img=http://www4.worldrag.com/imagem/di/8BSL/error.png&key=1af9e86da98e30538f0cbe1399bdb6876446e2d1e5414a60b418d9ce98c17aef" alt="error.png" />
frm_subcategoria.php
<?php include "config.php";
$acao = $_GET["acao"];
$id = $_GET["id"];
if ($acao != ""){
$sql = "select c.*, s.* from categorias c, subcategorias s where c.id_categoria = s.id_categoria and id_subcategoria= $id";
$resultado = mysql_query($sql);
$linha = mysql_fetch_array($resultado); //linha 10
$subcategoria = $linha[subcategoria];
$id_categoria = $linha["id_categoria"];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="99%" border="1" cellspacing="0" cellpadding="0">
<tr>
<th>Sub-categorias:</th>
</tr>
<tr>
<td height="93">
<form name="form1" method="post" action="op_subcategoria.php">
<table align="center" border = "1" width="450px">
<tr>
<td><strong>Categoria:</strong></td>
<td>
<select name="id_categoria">
<option></option>
<?php
$sql_cat = "select * from categorias order by categoria";
$result = mysql_query($sql_cat);
while($registro = mysql_fetch_array($result))
{
$valor = $registro["id_categoria"];
if ($id_categoria == $valor)
$selecionado = "selected";
else
$selecionado = "";
print"<option value = \"$valor\" $selecionado > $registro[categoria] </option>";
}
?>
</select>
</td>
</tr>
<tr>
<td><b>Sub-categoria:</b></td>
<td><input name="txt_subcategoria" id="txt_subcategoria" value="<?php echo $subcategoria; ?>" /></td>
</tr>
<tr>
<td colspan="2"><input name="id" type="hidden" value="<?php echo $id; ?>">
<input name="acao" type="hidden" value="<?php if($acao != ""){ echo $acao; }else{ echo "Inserir";}?>">
<input name="submit" type="submit" value="<?php if($acao != ""){ echo $acao; }else{ echo "Inserir";}?>"></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td height="21"> </td>
</tr>
</table>
</body>
</html>Carregando comentários...