SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2003
    Location
    uk
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking help with select statement in php/mysql

    Hi there
    Quick question im just stuck on the select statement.....
    This is the Scenario
    3 tables in the DB
    prod_description (products)
    (this consists of all the products..i.e phones,games.ettc..etc.
    comp_location (city)
    (this consists of whichiever city the product is based in.i.e london,manchester etc..)
    region
    (this can be either, local,national, or regional)
    now iw ant to do an advanced search for the following Scenarios)
    i have a forms to do the job
    the first seach option iwant to give the user is:
    Search for a product in a City which is either (local,national, or regional) <<--this being as a drop down box
    an example is:
    "Mobile Phone from London which is based Locally"
    the form is as follows
    2 text box and 1 drop down and a sumbit button
    first text box: user puts in product
    second text box : user puts in city
    3rd drop down menu: user can choose local.national or regional
    Code:
    <form name="form2" method="post" action="">
    				  <strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Search 
    				  by Product<br>
    				  Product 
    				  <input name="product" type="text" id="product">
    				  City</font></strong> 
    				  <input name="city" type="text" id="city">
    				  <select name="select2">
    					<option value="local">Local</option>
    					<option value="National">National</option>
    					<option value="Regional">Regional</option>
    				  </select>
    				  <br>
    				  <input type="submit" name="Submit2" value="Search">
    				  <br>
    				  <font size="2" face="Verdana, Arial, Helvetica, sans-serif">e.g 
    				  <strong>Mobile Phone</strong> from<strong> London</strong> which 
    				  is based <strong>Locally</strong> </font> 
    				</form>
    Second Search option is Display products by region
    so here for example
    i want to Search "london" and display all products that are Regional
    here is the form code:
    1 text box = user enters city
    1 drop down menu = user can select local/national/or regional
    so what it wants to do this one for example i want to display all products from london which are Local
    Code:
    <form name="form3" method="post" action="">
    				  <font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Search 
    				  by Competition Location Area</strong></font><br>
    				  <font size="2" face="Verdana, Arial, Helvetica, sans-serif">City</font> 
    				  <input name="city2" type="text" id="city2">
    				  <select name="select3">
    					<option value="local">Local</option>
    					<option value="national">National</option>
    					<option value="regional">Regional</option>
    				  </select>
    				  <input type="submit" name="Submit3" value="Search">
    				  <br>
    				  <font size="2" face="Verdana, Arial, Helvetica, sans-serif">e.g 
    				  All records that are Local to London</font> 
    				</form>
    can anyone help?
    im just confused as to how i wud write the select statement!!!1
    thanks in advanced
    bye for now
    s

  2. #2
    SitePoint Member
    Join Date
    Mar 2003
    Location
    uk
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry i meant to put COLUMNS instead of tables...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •