Jump to content


Photo

Jumpmenu


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

#1 gajowebmaster

gajowebmaster

    Novato no fórum

  • Usuários
  • 8 posts
  • Sexo:Não informado

Posted 12/12/2008, 11:08

ola pessoal tenho que fazer um jumpmenu ond eo cliente seleciona uma categoria e na proxima pagina aparece todos resultado do select. ja tentei com componente do dream e con esse codigo ....

ta retornando
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'form servicos set categoria1 = ''' at line 1
parece que ta enviando a variavel vazio o select da pagina de resultados ta assim
$q1 = "select * form servicos set categoria1 = '$_POST[f1]' ";
mysql_query($q1) or die(mysql_error());
print $f1;
exit();


[codebox]<?
require_once("configuracao_mysql.php");

?>

<br><br>
<form method=post name=f1 action = "resultadocategorias.php";>
<table align=center>
<tr>
<td colspan=2 align=center class=TableHead>&nbsp;</td>
</tr>
<tr>
<td>Selecione a categoria:</td>
<td>

<? //get the categories
$q1 = "select * from servicos_categ order by nome_categoria";
$r1 = mysql_query($q1) or die(mysql_error());

if(mysql_num_rows($r1) == '0')
{
echo "<br><center><font color=red face=verdana size=2><b>Não existem categorias!</b></font>";
exit();
}
else
{
$SelectCategory = "<select name=CategoriesList>\n\t<option value=\"\"></option>\n\t";
while($a1 = mysql_fetch_array($r1))
{
$SelectCategory .= "<option value=\"$a1[id_categoria]\">$a1[nome_categoria]</option>\n\t";
}
$SelectCategory .= "</select>";

?> </td>
</tr>

<tr>
<td>&nbsp;</td>
<td><input name=s1 type=submit class=sub value="Buscar"></td>
</tr>

</table>
</form>

<?
}
?>[/codebox]

#2 silici0

silici0

    ?

  • Usuários
  • 902 posts
  • Sexo:Masculino
  • Localidade:São Paulo - SP
  • Interesses:PHP, MySQL, XHTML, CSS, AJAX, JavaScript, Objective-C, Python, Games ... #geek

Posted 12/12/2008, 11:20

Da um echo na sua query ($q1) e verifica os valores, simples :P

Abraços
Procurando freelancer
***********************************************
Bachelor of Technology in Technology of Information, with great knowledge in Windows operating systems and Unix-Like (BSD, Ubuntu and Slackware), languages (PHP, JavaScript and MySQL), semantic (DHTML, Tableless, Ajax, MVC, OO) and analysis (manages projects based on PMI).
Developer in PHP, JAVA, Python, Objective-c MySQL, DHTML, CSS, JAVASCRIPT, JQUERY, JSON, SMARTY, MDB2, DOCTRINE, CAKEPHP. Linux desktop for work and MacOS. E-commerces, CRM and bussiness strategys
Love-me and be FREE use UniCes-Like .




1 user(s) are reading this topic

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

IPB Skin By Virteq