Jump to content

daniish

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Everything posted by daniish

  1. wow thanks very much, i will review these posts and get back to you. Many thanks
  2. Hello, I have written a simple html form with checkboxes, which refer to various services on offer. I have created a MySQL database with a single table listing location names and the services available at each ('1' representing the presence of a service - otherwise NULL if the service is not present). <form name="myform" action="search.php" method="GET"> <div align="left"><br> <input type="checkbox" name="option" value="Electricity"> Electricity<br> <input type="checkbox" name="option" value="Shower"> Shower<br> <input type="checkbox" name="option" value="Toilet"> Toilet<br> <input type="checkbox" name="option" value="Refuse-bin"> Refuse-bin<br> <br> <br> <input type="submit" type="Submit"> I need a little help with the php script which will be called when the form is submitted, to return the results. Users of this form will select multiple checkboxes and i need to return the names of locations which match the services selected. Being new to PHP i think that the script will need to create an array and then perhaps use the ISSET function to confirm which services were selected, but the ISSET function will not work directly with a mysql_query WHERE clause...perhaps i need to assign the chosen options to a variable somewhere first but i'm really not sure. I only have the following at the moment: $query = mysql_query("SELECT name FROM facilities WHERE 'option' ISSET")         or die ("Couln't execute query."); // Perform Query $result = mysql_query($query); echo "$result"; At the moment of course it does not work, but if someone could give me a few pointers it would be very much appreciated!
×
×
  • 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.