SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: i have two list boxes, depending on the values selected from the list boxes

  1. #1
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    i have two list boxes, depending on the values selected from the list boxes

    Hi

    all


    i have two list boxes, depending on the values selected from the list boxes, i want to execute the query on a mysql table.

    for eg:- one list box contains car brands(like tata, toyota) and another one contains car model (Indica, Innova)

    If user selects a brand tata and model Indica then in one of the text field I want to fetch the records from the table which can give me commission

    Any help is apprecieted

    Thanks
    MD.Samiuddin

  2. #2
    Non-Member
    Join Date
    Dec 2010
    Location
    /home/pc
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When the user clicks submit send the selected brand and model to a php script which runs a query something like

    Code SQL:
    $query = 'select commission from someTable where colBrand = "'.$brand.'" and model = "'.$model.'"';

    Make sure you sanitise the user inputs using either mysql_real_escape_string or prepared statements.

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
  •