hello!
Being a newbie (70 years young) I an trying to complete this php code so my search-form with a multichoice-checkbox may return a selected response on a webpage from mysql 5.4 database.
So far I have this query that is working BUT returning ALL members from the DTB regardless of requested specialties or zip
WHAT I NEED TO DO:
I only need visitors to be able to retreive pet Service providers from our group, performing one or several requested services (checkbox) within the client zipcode (drop-down menu showing available zipcodes) - since providers go to the client's place.
a text entry would make the client entering HIs own zip code that is not nessessarily covered by the group so a dropdown menu (single zipcode choice) is preferable-showing only covered zip codes areas)
I know I am missing "WHERE specialty=??? and WHERE zip=??? on line 2, following the "SELECT from mydtb_table" query but all I tryed is returning syntax errors or blanc page..
Can anyone can help me finish this. Please?
I am using Mysql 5.5.40 and phpmyadmin 5.4
I made my HTML form using a software that wrote every code for me exepted that is only sending emails and POSt to the database,( not retreiving from a multicheckbox,) so I had to replace its php file with my own (that is
working exepted, as I said earlier, it is returning a webpage with the COMPLETE List from the DTB, REGARDLESS.
<?php
** $result = mysql_query("SELECT * FROM wp_uvmj_participants_database", $db);**
if (!$result) {
die("Database query failed: " . mysql_error());
}
while ($row = mysql_fetch_array($result)) {
echo "<h2>";
echo $row[company]."";
echo "</h2>";
echo "<p>";
echo $row[first_name];
echo $row[specialty];
echo $row[sub_category];
echo $row[area];
echo $row[photo];
echo $row[bio];
echo "</p>";
}
?>
</div>
</body>
</html>
<?php
mysql_close($db);
?>