Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - how to create multiple search page
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to create multiple search page

 Post Reply Post Reply Page  12>
Author
squalleonhart View Drop Down
Newbie
Newbie


Joined: 20 March 2003
Location: Malaysia
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote squalleonhart Quote  Post ReplyReply Direct Link To This Post Topic: how to create multiple search page
    Posted: 20 March 2003 at 10:22am

i have a problem to create a multiple search page, for ur all info. i want to create the search page like this...

i want to search the data from table car

n i can search by select the car make, car year, and car price

n for car price, i divide it into 5 categories

ANY = BETWEEN 1 AND 250000
under 20000 = BETWEEN 1 AND 19999
20000-50000 = BETWEEN 20000 AND 49999
50000-100000 = BETWEEN 50000 AND 99999
ABOVE 100000 = BETWEEN 100000 AND 250000

n this is my SQL that i create b4

SELECT *
FROM Car
WHERE Price MMColParam AND Make = 'Make' AND Year = 'Car_Year'
ORDER BY Price ASC

any solution 4 this problem...

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2003 at 10:42am

strSQL = "Select * from car where Make = '" & Make & "' AND YEAR = '" & YEAR "' AND (Price " & MMColParam & ")"
Now MMColParam needs to post something like BETWEEN 1 AND 19999

Back to Top
squalleonhart View Drop Down
Newbie
Newbie


Joined: 20 March 2003
Location: Malaysia
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote squalleonhart Quote  Post ReplyReply Direct Link To This Post Posted: 24 March 2003 at 5:30am

i used this coding(above) but the error still occurs...

can someone edit my coding here..

this one, coding for search page

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/concartrader.asp" -->
<%
Dim search
Dim search_numRows

Set search = Server.CreateObject("ADODB.Recordset")
search.ActiveConnection = MM_concartrader_STRING
search.Source = "SELECT * FROM Car"
search.CursorType = 0
search.CursorLocation = 2
search.LockType = 1
search.Open()

search_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>E-Car Trader</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="64%"  border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td width="90%" colspan="2"><img src="images/hr_top.gif" width="449" height="22"></td>
    <td width="10%" rowspan="9">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#0099FF"> <div align="left"></div>
      <strong><font face="Harpoon">Search Advance</font></strong></td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#ADD0FF">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#D9E9FF"><form action="result.asp" method="post" name="search1" id="search1">
        <table width="100%" border="0">
          <tr>
            <td>Make:</td>
            <td><select name="Make" id="Make">
                <option value="Alfa">Alfa</option>
                <option value="Audi">Audi</option>
                <option value="BMW">BMW</option>
                <option value="Citroen">Citroen</option>
                <option value="Daihatsu">Daihatsu</option>
                <option value="Ferrari">Ferrari</option>
                <option value="Fiat">Fiat </option>
                <option value="Ford">Ford </option>
                <option value="Honda">Honda</option>
                <option value="Hyundai">Hyundai</option>
                <option value="Isuzu">Isuzu</option>
                <option value="Jaguar">Jaguar</option>
                <option value="Kia">Kia</option>
                <option value="Lotus">Lotus</option>
                <option value="Mazda">Mazda</option>
                <option value="Merz">Merz</option>
                <option value="Mitusbishi">Mistubishi</option>
                <option value="Nissan">Nissan</option>
                <option value="Opel">Opel</option>
                <option value="Pegeout">Pegeout</option>
                <option value="Perodua">Perodua</option>
                <option value="Porsche">Porsche</option>
                <option value="Proton" selected>Proton</option>
                <option value="Renault">Renault</option>
                <option value="Suzuki">Suzuki</option>
                <option value="Toyota">Toyota</option>
                <option value="Volvo">Volvo</option>
                <option value="Volkswagen">Volkswagen</option>
              </select></td>
            <td>ex: Proton</td>
          </tr>
          <tr>
            <td>Year: </td>
            <td><select name="Car_Year" id="Car_Year">
                <option value="1980" selected>1980</option>
                <option value="1981">1981</option>
                <option value="1982">1982</option>
                <option value="1983">1983</option>
                <option value="1984">1984</option>
                <option value="1985">1985</option>
                <option value="1986">1986</option>
                <option value="1987">1987</option>
           &nbs

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 24 March 2003 at 10:07am
And the error is??
Back to Top
squalleonhart View Drop Down
Newbie
Newbie


Joined: 20 March 2003
Location: Malaysia
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote squalleonhart Quote  Post ReplyReply Direct Link To This Post Posted: 25 March 2003 at 2:31am

this is error when i want to search the data from my database

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '(Price + Replace(result1__MMColParam,'.
/cartrader/result.asp, line 34

  • Page:
    POST 70 bytes to /cartrader/result.asp

  • POST Data:
    Make=Volvo&Car_Year=2000&Price=BETWEEN+100000+AND+250000&Submit=Search
  • Back to Top
    squalleonhart View Drop Down
    Newbie
    Newbie


    Joined: 20 March 2003
    Location: Malaysia
    Status: Offline
    Points: 7
    Post Options Post Options   Thanks (0) Thanks(0)   Quote squalleonhart Quote  Post ReplyReply Direct Link To This Post Posted: 25 March 2003 at 2:41am

    i think the main problem for this question is SQL, it's become a problem when i want to search by price..

    can someone fix it to me

    Back to Top
    Scotty32 View Drop Down
    Moderator Group
    Moderator Group


    Joined: 30 November 2002
    Location: Manchester, UK
    Status: Offline
    Points: 1682
    Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 25 March 2003 at 6:48am

    i dont know much ASP but have you put the last couple of ")" in it?

    '(Price + Replace(result1__MMColParam))'

    does it look like that, cose its sayin sumfins missin so could be that

    but like i said, i dont know much asp

    Back to Top
    faubo View Drop Down
    Senior Member
    Senior Member
    Avatar

    Joined: 30 May 2002
    Location: Brazil
    Status: Offline
    Points: 560
    Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post Posted: 25 March 2003 at 8:00am

    yep, review your query, the error is saying is a sintax error, believe it.

    Meybe a " or a ) or something else is missising.

    Back to Top
     Post Reply Post Reply Page  12>

    Forum Jump Forum Permissions View Drop Down

    Forum Software by Web Wiz Forums® version 12.08
    Copyright ©2001-2026 Web Wiz Ltd.


    Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
    About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

    Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
    Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

    Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

    Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.