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> </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> </td>
<td><input name=s1 type=submit class=sub value="Buscar"></td>
</tr>
</table>
</form>
<?
}
?>[/codebox]

Jumpmenu
Started By gajowebmaster, 12/12/2008, 11:08
1 reply to this topic
#1
Posted 12/12/2008, 11:08
#2
Posted 12/12/2008, 11:20
Da um echo na sua query ($q1) e verifica os valores, simples 
Abraços

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 .
***********************************************
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)