Forums
This topic is locked
Form Search Query problem
Posted 18 Jan 2007 18:16:18
1
has voted
18 Jan 2007 18:16:18 Aaron Zimmer posted:
Hey -- THis may sound like a 2nd grade question, but I'm stupmed nonetheless. I'm trying to use a simple search to access articles in a database. I'm completely stumped as to what I'm not doing right. Any help in any way would be GREATLY appreciated! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>-Page Code copied below-
Thanks
Aaron
Dreamweaver MX|MySQL|ASP
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/WaveBiscuit.asp" -->
<%
var rsBlogSearch__MMColParam = "1";
if (String(Request.QueryString("input") != "undefined" &&
String(Request.QueryString("input") != "" {
rsBlogSearch__MMColParam = String(Request.QueryString("input");
}
%>
<%
var rsBlogSearch = Server.CreateObject("ADODB.Recordset"
rsBlogSearch.ActiveConnection = MM_WaveBiscuit_STRING;
rsBlogSearch.Source = "SELECT blog_item_id, blog_item FROM dbo187932498.blog_items WHERE blog_item LIKE '"+ rsBlogSearch__MMColParam.replace(/'/g, "''" + "%' ORDER BY blog_item_id ASC";
rsBlogSearch.CursorType = 0;
rsBlogSearch.CursorLocation = 2;
rsBlogSearch.LockType = 1;
rsBlogSearch.Open();
var rsBlogSearch_numRows = 0;
%>
<%
var rsdisplayblog = Server.CreateObject("ADODB.Recordset"
rsdisplayblog.ActiveConnection = MM_WaveBiscuit_STRING;
rsdisplayblog.Source = "SELECT blog_item_datetime FROM dbo187932498.blog_items ORDER BY blog_item_datetime DESC";
rsdisplayblog.CursorType = 0;
rsdisplayblog.CursorLocation = 2;
rsdisplayblog.LockType = 1;
rsdisplayblog.Open();
var rsdisplayblog_numRows = 0;
%>
<%
var Repeat1__numRows = -1;
var Repeat1__index = 0;
rsBlogSearch_numRows += Repeat1__numRows;
%>
<html>
<head>
<title>WaveBiscuit - Biscuit Says!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.border {
right: 20px;
text-indent: 20pt;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#"!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?")>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body bgcolor="#E8E0CF" onLoad="MM_preloadImages('Elements/Elements/images/SplashBar_r2_c2.gif','Elements/Elements/images/SplashBar_r2_c2_f2.gif','Elements/Elements/images/SplashBar_r2_c3.gif','Elements/Elements/images/SplashBar_r2_c3_f3.gif','Elements/Elements/images/SplashBar_r2_c4.gif','Elements/Elements/images/SplashBar_r2_c4_f4.gif','Elements/Elements/images/SplashBar_r2_c6_f5.gif')">
<table width="980" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<!--DWLayoutTable-->
<tr>
<td height="170" colspan="5" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="978">
<!--DWLayoutTable-->
<!-- fwtable fwsrc="SplashBar.png" fwbase="SplashBar.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<td width="979" height="151" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="978">
<!--DWLayoutTable-->
<!-- fwtable fwsrc="SplashBar.png" fwbase="SplashBar.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="209" height="1" border="0"></td>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="182" height="1" border="0"></td>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="171" height="1" border="0"></td>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="156" height="1" border="0"></td>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="10" height="1" border="0"></td>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="153" height="1" border="0"></td>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="97" height="1" border="0"></td>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="1" height="1" border="0"></td>
</tr>
<tr>
<td colspan="7"><img name="SplashBar_r1_c1" src="Elements/Elements/images/SplashBar_r1_c1.gif" width="978" height="7" border="0" alt=""></td>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="1" height="7" border="0"></td>
</tr>
<tr>
<td rowspan="2"><img name="SplashBar_r2_c1" src="Elements/Elements/images/SplashBar_r2_c1.gif" width="209" height="143" border="0" usemap="#m_SplashBar_r2_c1" alt=""></td>
<td><a href="#" onMouseOut="MM_swapImage('SplashBar_r2_c2','','Elements/Elements/images/SplashBar_r2_c2.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c2','','Elements/Elements/images/SplashBar_r2_c2_f2.gif',1);"><img name="SplashBar_r2_c2" src="Elements/Elements/images/SplashBar_r2_c2.gif" width="182" height="57" border="0" usemap="#m_SplashBar_r2_c2" alt=""></a></td>
<td><a href="#" onMouseOut="MM_swapImage('SplashBar_r2_c3','','Elements/Elements/images/SplashBar_r2_c3.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c3','','Elements/Elements/images/SplashBar_r2_c3_f3.gif',1);"><img name="SplashBar_r2_c3" src="Elements/Elements/images/SplashBar_r2_c3.gif" width="171" height="57" border="0" usemap="#m_SplashBar_r2_c3" alt=""></a></td>
<td><a href="#" onMouseOut="MM_swapImage('SplashBar_r2_c4','','Elements/Elements/images/SplashBar_r2_c4.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c4','','Elements/Elements/images/SplashBar_r2_c4_f4.gif',1);"><img name="SplashBar_r2_c4" src="Elements/Elements/images/SplashBar_r2_c4.gif" width="156" height="57" border="0" usemap="#m_SplashBar_r2_c4" alt=""></a></td>
<td rowspan="2"><img name="SplashBar_r2_c5" src="Elements/Elements/images/SplashBar_r2_c5.gif" width="10" height="143" border="0" alt=""></td>
<td><a href="index.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('SplashBar_r2_c6','','Elements/Elements/images/SplashBar_r2_c6_f5.gif',1);"><img name="SplashBar_r2_c6" src="Elements/Elements/images/SplashBar_r2_c6.gif" width="153" height="57" border="0" alt=""></a></td>
<td rowspan="2"><img name="SplashBar_r2_c7" src="Elements/Elements/images/SplashBar_r2_c7.gif" width="97" height="143" border="0" alt=""></td>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="1" height="57" border="0"></td>
</tr>
<tr>
<td colspan="3"><img name="SplashBar_r3_c2" src="Elements/Elements/images/SplashBar_r3_c2.gif" width="509" height="86" border="0" alt=""></td>
<td><img name="SplashBar_r3_c6" src="Elements/Elements/images/SplashBar_r3_c6.gif" width="153" height="86" border="0" alt=""></td>
<td><img src="Elements/Elements/images/spacer.gif" alt="" name="undefined_2" width="1" height="86" border="0"></td>
</tr>
<map name="m_SplashBar_r2_c1">
<area shape="rect" coords="7,5,201,136" href="index.asp" alt="" >
</map>
<map name="m_SplashBar_r2_c2">
<area shape="rect" coords="0,0,182,57" href="archive.asp" alt="" onMouseOut="MM_swapImage('SplashBar_r2_c2','','Elements/Elements/images/SplashBar_r2_c2.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c2','','Elements/Elements/images/SplashBar_r2_c2_f2.gif',1);" >
</map>
<map name="m_SplashBar_r2_c3">
<area shape="rect" coords="0,0,171,57" href="askbiscuit.asp" alt="" onMouseOut="MM_swapImage('SplashBar_r2_c3','','Elements/Elements/images/SplashBar_r2_c3.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c3','','Elements/Elements/images/SplashBar_r2_c3_f3.gif',1);" >
</map>
<map name="m_SplashBar_r2_c4">
<area shape="rect" coords="0,0,156,57" href="biscuitsays.asp" alt="" onMouseOut="MM_swapImage('SplashBar_r2_c4','','Elements/Elements/images/SplashBar_r2_c4.gif',1);" onMouseOver="MM_swapImage('SplashBar_r2_c4','','Elements/Elements/images/SplashBar_r2_c4_f4.gif',1);" >
</map>
</table></td>
</tr>
<tr>
<td height="19" valign="top" bgcolor="#FFFFFF"><font face="Arial"> Last
Updated: <%=(rsdisplayblog.Fields.Item("blog_item_datetime".Value)%></font></td>
</tr>
</table></td>
</tr>
<tr>
<td height="19" colspan="5" valign="top"><img src="Elements/SplashBar/SplashBarBottom.jpg" width="980" height="19"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="41" colspan="5" valign="top"> <div align="center"><img src="Elements/Elements/AskBiscuitTopBar.gif" width="761" height="41"></div></td>
</tr>
<tr>
<td height="20" colspan="5" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td width="214" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="34" height="200"> </td>
<td colspan="3" valign="top" bgcolor="#FFFFCC"><div align="center"><img src="Elements/Elements/Ad3.gif" width="150" height="200"></div></td>
<td width="30"> </td>
</tr>
<tr>
<td height="29"> </td>
<td width="11"> </td>
<td width="130"> </td>
<td width="9"> </td>
<td> </td>
</tr>
<tr>
<td height="183"> </td>
<td> </td>
<td valign="top"><img src="Elements/Elements/Ad3.jpg" width="130" height="183"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="132"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
<td height="431" colspan="3" valign="top" bgcolor="#FFFFFF"> <% while ((Repeat1__numRows-- != 0) && (!rsBlogSearch.EOF)) { %>
<p class="border"><font size="5" face="Arial, Helvetica, sans-serif"><strong><%=(rsBlogSearch.Fields.Item("blog_item_ID".Value)%><br>
</strong></font><font face="Arial, Helvetica, sans-serif"><%=(rsBlogSearch.Fields.Item("blog_item".Value)%></font><font color="#CC0000" face="Arial, Helvetica, sans-serif"><br>
________________________________________________</font></p>
<%
Repeat1__index++;
rsBlogSearch.MoveNext();
}
%>
</td>
<td width="214" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="214" height="257" valign="top"><div align="center"><img src="Elements/Elements/BeachNutsBox.jpg" width="177" height="233"></div></td>
</tr>
<tr>
<td height="107" valign="top"><div align="center"><img src="Elements/Elements/Ad2.jpg" width="150" height="120"></div></td>
</tr>
<tr>
<td height="19"> </td>
</tr>
<tr>
<td height="104" valign="top"><div align="center"><img src="Elements/Elements/Ad1.gif" width="209" height="97"></div></td>
</tr>
<tr>
<td height="44"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="89" height="113" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell--> </td>
<td width="346" valign="top"><img src="Elements/Elements/Disclaimer.gif" width="346" height="100"></td>
<td width="117" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="19" colspan="5" valign="top"><img src="Elements/SplashBar/SplashBarBottom.jpg" width="980" height="19"></td>
</tr>
</table>
</body>
</html>
<%
rsBlogSearch.Close();
%>
<%
rsdisplayblog.Close();
%>