Ask a Question related to Coldfusion Database Access, Design and Development.
-
Bskyweb #1
Search results
When i search it returns all the rows; not the ones i've searched for. Any help
would be appreciated.
do i end my search page with CFM also?
<cfparam name="PageNum_Recordset1" default="1">
<cfquery name="Recordset1" datasource="CompanyInfo">
SELECT *
FROM Departmt
</cfquery>
<cfset MaxRows_Recordset1=10>
<cfset
StartRow_Recordset1=Min((PageNum_Recordset1-1)*MaxRows_Recordset1+1,Max(Recordse
t1.RecordCount,1))>
<cfset
EndRow_Recordset1=Min(StartRow_Recordset1+MaxRows_ Recordset1-1,Recordset1.Record
Count)>
<cfset
TotalPages_Recordset1=Ceiling(Recordset1.RecordCou nt/MaxRows_Recordset1)>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<table border="1">
<tr>
<td>Dept_ID</td>
<td>Dept_Name</td>
<td>Location</td>
</tr>
<cfoutput query="Recordset1" startRow="#StartRow_Recordset1#"
maxRows="#MaxRows_Recordset1#">
<tr>
<td>#Recordset1.Dept_ID#</td>
<td>#Recordset1.Dept_Name#</td>
<td>#Recordset1.Location#</td>
</tr>
</cfoutput>
And my search page:
<form action="results.cfm" method="post" name="Forum" id="Forum">
<input name="frmIn_DPT_ID" type="text" id="frmIn_DPT_ID">
<input type="submit" name="Submit" value="Submit">
</form>
Bskyweb Guest
-
Width of SEARCH results
Is it possible to control the amount of context showing in the results of the SEARCH operation, say in Reader 7? The context appears to show perhaps... -
Sending search results to a results page..with asp
Please help.. very :confused; Ive setup 4 dynamic drop down boxes which populate themselves from my database, this all works fine..The last box... -
Help with search results in asp vbs
I have this query: SELECT * FROM dbo.subwatch WHERE subname like 'varsubname%' AND vendornum like 'varvendornum%' AND city like 'varcity%' AND... -
Search within Search Results
I am trying to do a search within query results: My first search executes fine, but my second search uses the WHERE parameters of my first... -
Saving search results?
In windows 98 you can save search results as a .fnd file. How do I do this in XP? Please help. Do I have to go back to win98? -
Neculai Macarie #2
Re: Search results
> When i search it returns all the rows; not the ones i've searched for. Any
helpTry this:> would be appreciated.
> do i end my search page with CFM also?
<cfquery name="Recordset1" datasource="CompanyInfo">
SELECT *
FROM Departmt
WHERE 1=1
<cfif StructKeyExists(Form, "frmIn_DPT_ID")>
AND Dept_Name like <cfqueryparam cfsqltype="CF_SQL_VARCHAR"
value="%#form.frmIn_DPT_ID#%">
</cfif>
</cfquery>
It will search for the entered keywords in department names.
--
<mack />
Neculai Macarie Guest
-
Bskyweb #3
Re: Search results
Thanks, worked like a charm (well... one that works anway...)
Bskyweb Guest
-
Bskyweb #4
Re: Search results
Ok,
Now i need to search a column called keywords, this is what i hve tried:
<cfquery name="Recordset1" datasource="GOV">
SELECT *
FROM GOV_Table
WHERE 1=1
<cfif StructKeyExists(Form, "frmIn_DPT_ID")>
AND Keywords like <cfqueryparam cfsqltype="CF_SQL_VARCHAR"
value="%#form.frmIn_DPT_ID#%">
</cfif>
</cfquery>
<cfoutput query="Recordset1" startRow="#StartRow_Recordset1#"
maxRows="#MaxRows_Recordset1#">
<tr>
<td>#Recordset1.File_Name#</td>
<td>#Recordset1.URL_of_file#</td>
</tr>
</cfoutput>
For the cfoutput i didnt want it to show the Keywords so i deleted the column,
Is that ok?
And my search Page is the same as before
Bskyweb Guest



Reply With Quote

