SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 28 of 28
  1. #26
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Well, it seems you are not POST ing anything to the form handler?

    If you selected vehicle "Jeep" from the list and submitted the form when you var_dump the POST vars you should see the likes of :

    PHP Code:
    array('vehicle' => 'Jeep'
    Show us the html which is generated for the page with the form on it (ie html "view source")

  2. #27
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    this explains why you are returning all rows in the table, correct?

    you've forgotten the WHERE clause
    So what do i need to put there.

    Also when i put it after the defined variables i get

    eg.
    var_dump($_POST['vehicles']);

    string(8) "Sedan"

  3. #28
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    You said:

    My problem is when i try to search for sedan and there are no sedans in my database i display all records, how do i get the query to display nothing if there is nothing in my database.
    So when you fill in your form, select "Sedan" what does

    PHP Code:
     echo $query_rsTest
    .. give you?

    Also, try changing this line
    PHP Code:
    if (isset ($_POST ['vehicles']) && ($_POST ['radioVehicles'])) { 
    to this (for now)
    PHP Code:
    if (isset ($_POST ['vehicles']) ) { 


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
  •