Jump to content

php2learn

New Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by php2learn

  1. @fastsol & Psycho, The code worked for me. Thanks a lot. Sure, next time I will provide as much information possible to demonstrate what I'm looking for.
  2. @fastsol I managed to use your code and it prints the category in array. I'm not sure about the next step how to pass the array of values into the comma separated list as suggested by Psycho. If possible, you provide me the code. Otherwise, I will keep trying and let you know if I succeed. Thank you.
  3. Thank you. For your information, I'm new to PHP stuff. I already saw similar kind of examples online in many forum but I can't quite understand how I can relate that for my need. For e.g. in your example, you haven't set any variable but I want $category to be set.
  4. @gizmola As of now, I have the following following php file. <?php $category = isset( $_REQUEST['category']) ? $_REQUEST['category'] : null; <?> <body> <form action = $_SERVER['PHP_SELF'] name = "form1" method = "post"> <select name="category" multiple = "multiple"> <option value = "A-t1"> A-T1 </option> <option value = "B-t1">B-T1 </option> <option value = "C-t1">C-T1 </option> <option value = "D-t1">D-T1 </option>
  5. I have a sql query similar to below in a .php file. $sql = "select id,organisation,price from table where category = '$category'; These are the four unique values of the category column for your reference. "A-t1" "B-t1" "C-t1" "D-t1" Now I want to create a dropdown list or listbox in .php file with option to select multiple values. If customer selects multiple values, it should fetch query for the selected categories. E.g. dropdown list should be similar to below : "A-t1" "B-t1" "C-t1" "D-t1" If an user selects "A-t1" and "C-t1", it should give output/query for the selected categories.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.