Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
boas pessoal quero fazer uma consulta a uma base de dados em que tenho 3 option titulo, data e texto. escolhe a opcao por exp titulo e na caixa de texto escolho um titulo que quero procurar.
eu tenho ja o seguinte codigo mas nao me esta a funcionar.
1 parte:
<!--#include file="conn.asp" -->
<!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">](http://www.w3.org/1999/xhtml)
<link rel="stylesheet" href="style3.css" />
<form method="post" action="pesquisacomunicado3.asp" class="sortable">
<br>
<center>
<table>
<td>Procurar por:</td>
<td> <select name="valor">
<option name="valor">titulo</option>
<option name="valor">Data</option>
<option name="valor">Texto</option>
</select></td><td><input type="text" name="texto"/></td>
<td><input type=submit value="Procurar"/></td>
</table>
</form>
</center><!--#include file="conn.asp" -->
<!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">](http://www.w3.org/1999/xhtml)
<link rel="stylesheet" href="style3.css" />
<%
valor1=request.form("valor")
texto1=request.form("texto")
Set RS = Conexao.Execute("SELECT '"&valor1&"' FROM comunicado where ('"&valor1&"'='"&texto1&"')")
%>
<%
If RS.Eof Then
response.write "vazio"
%>
<%
else
%>
<table class="sortable" >
<tr>
<% While Not rs.Eof %>
<td align="center"><% Response.Write(rs("titulo")) %></Td>
<tr>
<td align="left" border-style:none;><% Response.Write(rs("datai")) %></Td>
</tr>
<td align="left"><br><% Response.Write(rs("texto")) %></td></p>
</tr>
<%
rs.MoveNext : Wend
End If
%>
Carregando comentários...