Digowarta51 Postado Junho 8, 2004 Denunciar Share Postado Junho 8, 2004 por q q quando eu clico no botao "ok" ele me retorna o erro:<input name="id_tec_de" type="text" id="id_tec_de" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" title="Nome do tecnico que informará o recado" value="Warning: pg_query() query failed: ERRO: syntax error no fim da entrada at character 61 in /var/www/html/sistema/cadastro.php on line 52Erro na pesquisa: select id_tecnico, login from jcs.tecnicos where id_tecnico=. ERRO: syntax error no fim da entrada at character 61 O CÓDIGO TA AI EMBAIXO:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Cadastrar tarefa</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><script language="JavaScript" type="text/JavaScript"><!--function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0;}//--></script></head><body><table width=497" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="497" height="141" valign="top"><form name="form1" method="post" action="cadastro.php?acao=ok"> <p> <table width="497" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000" frame="box" style="border-collapse:collapse"> <!--DWLayoutTable--> <tr> <td width="83" height="4"></td> <td width="4"></td> <td width="120"></td> <td width="15"></td> <td width="47"></td> <td width="104"></td> <td width="4"></td> <td width="120"></td> </tr> <tr> <td height="20" valign="middle"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Recado de:</strong></font></td> <td></td> <td valign="top"><input name="id_tec_de" type="text" id="id_tec_de" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" title="Nome do tecnico que informará o recado" value="<? $id_login = $_GET["id_login]; $query="select id_tecnico, login from jcs.tecnicos where id_tecnico=$id_login"; $result= pg_query($connection, $query) or die("Erro na pesquisa: $query. " .pg_last_error($connection)); $rows = pg_num_rows($result); $row = pg_fetch_row($result, 0); echo $row[1] ; ?>" readonly=true"></td> <td></td> <td valign="middle"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Para:</font></strong></td> <td valign="top"> <div align="center"> <select name="id_tec_para" id="id_tec_para" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" onChange="MM_jumpMenu('parent',this,0)"> <option value="todos">Todos</option> <?php $query = "select id_tecnico, login from jcs.tecnicos"; $result= pg_query($connection, $query) or die("Erro na pesquisa: $query. " .pg_last_error($connection)); $rows = pg_num_rows($result); for ($i=0; $i<$rows; $i++) { $row = pg_fetch_row($result, $i); echo"<option value='$row[0]'>$row[1]</option>"; } ?> </select> </div></td> <td> </td> <td> </td> </tr> <tr> <td height="65" valign="middle"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Recado:</strong></font></td> <td> </td> <td colspan="5" valign="top"><textarea name="recado" cols="50" rows="5" id="recado" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF"></textarea></td> <td> </td> </tr> <tr> <td height="16"></td> <td colspan="5" valign="top"><div align="center"> <input type="submit" name="Submit" value="Ok" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #e9e9e9"> <input type="reset" name="Submit2" value="Limpar" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #e9e9e9"> </div></td> <td></td> <td></td> </tr> </table> </form></td> </tr></table><?Php$acao = $_GET["acao];$id_login = $_GET["id_login"];if ($acao == "ok") { echo $acao; //$insere = "INSERT INTO jcs.recados (id_tec_de, id_tec_para, recado) values ($id_tec_de, '$id_tec_para', '$recado') ";}?></body></html> Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 Fabyo Postado Junho 8, 2004 Denunciar Share Postado Junho 8, 2004 Tenta ai não testei<?$id_login = $_GET["id_login"];$query=select id_tecnico, login from jcs.tecnicos where id_tecnico = '$id_login'";$result= pg_query($connection, $query) or die("Erro na pesquisa: $query. " .pg_last_error($connection)); $rows = pg_num_rows($result); $row = pg_fetch_row($result, 0); ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Cadastrar tarefa</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><script language="JavaScript" type="text/JavaScript"><!--function MM_jumpMenu(targ,selObj,restore){ //v3.0eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");if (restore) selObj.selectedIndex=0;}//--></script></head><body><table width="497" border="0" cellpadding="0" cellspacing="0"><!--DWLayoutTable--><tr> <td width="497" height="141" valign="top"><form name="form1" method="post" action="cadastro.php?acao=ok"><p> <table width="497" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000" frame="box" style="border-collapse:collapse"><!--DWLayoutTable--><tr> <td width="83" height="4"></td><td width="4"></td><td width="120"></td><td width="15"></td><td width="47"></td><td width="104"></td><td width="4"></td><td width="120"></td></tr><tr> <td height="20" valign="middle"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Recado de:</strong></font></td><td></td><td valign="top"><input name="id_tec_de" type="text" id="id_tec_de" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" title="Nome do tecnico que informará o recado" value="<?= $row[1]?>" readonly="true"></td><td></td><td valign="middle"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Para:</font></strong></td><td valign="top"> <div align="center"> <select name="id_tec_para" id="id_tec_para" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" onChange="MM_jumpMenu('parent',this,0)"><option value="todos">Todos</option><?php$query = "select id_tecnico, login from jcs.tecnicos";$result= pg_query($connection, $query) or die("Erro na pesquisa: $query. " .pg_last_error($connection));$rows = pg_num_rows($result);for ($i=0; $i<$rows; $i++){$row = pg_fetch_row($result, $i);echo"<option value='$row[0]'>$row[1]</option>";}?></select></div></td><td> </td><td> </td></tr><tr> <td height="65" valign="middle"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Recado:</strong></font></td><td> </td><td colspan="5" valign="top"><textarea name="recado" cols="50" rows="5" id="recado" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF"></textarea></td><td> </td></tr><tr> <td height="16"></td><td colspan="5" valign="top"><div align="center"> <input type="submit" name="Submit" value="Ok" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #e9e9e9"><input type="reset" name="Submit2" value="Limpar" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #e9e9e9"></div></td><td></td><td></td></tr></table></form></td></tr></table><?Php$acao = $_GET["acao];$id_login = $_GET["id_login"];if ($acao == "ok") {echo $acao;//$insere = "INSERT INTO jcs.recados (id_tec_de, id_tec_para, recado) values ($id_tec_de, '$id_tec_para', '$recado') ";}?></body></html> Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 Nerdao Postado Junho 8, 2004 Denunciar Share Postado Junho 8, 2004 Cara primeiro organiza seu script fazendo uma folha de stilo ! exemplo !<style>.CAXA{BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF";</style><input name="id_tec_de" type="text" id="id_tec_de" class="CAIXA" value="<?= $row[1]?>" readonly="true">ai voce não precisa ficar colocando todo este codigo no input !basta coloca um tag "(CLASS)" fica mauis bonito o script e bem mais facil de entender "ATT:KADU Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 Fabyo Postado Junho 8, 2004 Denunciar Share Postado Junho 8, 2004 É isso ai KADU, sempre é bom deixar as coisas mais organizadas fica mais facilde entender e de descobrir algum erro Citar Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Digowarta51
por q q quando eu clico no botao "ok" ele me retorna o erro:
<input name="id_tec_de" type="text" id="id_tec_de" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" title="Nome do tecnico que informará o recado" value="
Warning: pg_query() query failed: ERRO: syntax error no fim da entrada at character 61 in /var/www/html/sistema/cadastro.php on line 52
Erro na pesquisa: select id_tecnico, login from jcs.tecnicos where id_tecnico=. ERRO: syntax error no fim da entrada at character 61
O CÓDIGO TA AI EMBAIXO:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Cadastrar tarefa</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<table width=497" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="497" height="141" valign="top"><form name="form1" method="post" action="cadastro.php?acao=ok">
<p>
<table width="497" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000" frame="box" style="border-collapse:collapse">
<!--DWLayoutTable-->
<tr>
<td width="83" height="4"></td>
<td width="4"></td>
<td width="120"></td>
<td width="15"></td>
<td width="47"></td>
<td width="104"></td>
<td width="4"></td>
<td width="120"></td>
</tr>
<tr>
<td height="20" valign="middle"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Recado
de:</strong></font></td>
<td></td>
<td valign="top"><input name="id_tec_de" type="text" id="id_tec_de" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" title="Nome do tecnico que informará o recado" value="<? $id_login = $_GET["id_login]; $query="select id_tecnico, login from jcs.tecnicos where id_tecnico=$id_login"; $result= pg_query($connection, $query) or die("Erro na pesquisa: $query. " .pg_last_error($connection)); $rows = pg_num_rows($result); $row = pg_fetch_row($result, 0); echo $row[1] ; ?>" readonly=true"></td>
<td></td>
<td valign="middle"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Para:</font></strong></td>
<td valign="top"> <div align="center">
<select name="id_tec_para" id="id_tec_para" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" onChange="MM_jumpMenu('parent',this,0)">
<option value="todos">Todos</option>
<?php
$query = "select id_tecnico, login from jcs.tecnicos";
$result= pg_query($connection, $query) or die("Erro na pesquisa: $query. " .pg_last_error($connection));
$rows = pg_num_rows($result);
for ($i=0; $i<$rows; $i++)
{
$row = pg_fetch_row($result, $i);
echo"<option value='$row[0]'>$row[1]</option>";
}
?>
</select>
</div></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="65" valign="middle"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Recado:</strong></font></td>
<td> </td>
<td colspan="5" valign="top"><textarea name="recado" cols="50" rows="5" id="recado" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF"></textarea></td>
<td> </td>
</tr>
<tr>
<td height="16"></td>
<td colspan="5" valign="top"><div align="center">
<input type="submit" name="Submit" value="Ok" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #e9e9e9">
<input type="reset" name="Submit2" value="Limpar" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #e9e9e9">
</div></td>
<td></td>
<td></td>
</tr>
</table>
</form></td>
</tr>
</table>
<?Php
$acao = $_GET["acao];
$id_login = $_GET["id_login"];
if ($acao == "ok") {
echo $acao;
//$insere = "INSERT INTO jcs.recados (id_tec_de, id_tec_para, recado) values ($id_tec_de, '$id_tec_para', '$recado') ";
}
?>
</body>
</html>
Link para o comentário
Compartilhar em outros sites
3 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.