For some reason, my PHP code won't show up database in the drop down box that I retrieve from MySQL. CS_JOBS
and CS_JOBS_CATEGORY
are tables in the database. I join CS_JOBS_CATEGORY
and CS_JOBS
, since they both have the same category_code
column. I already tested connect.php
, it's working fine.
<?php
require("connect.php");
$sql = "SELECT category_name FROM CS_JOBS_CATEGORY";
$result = mysql_query($sql);
echo "<select name='category_name'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='".$row['category_name']."'>".$row['category_name']."</option>";
}
echo "</select>";
?>
My goal is to show all category_name
in the drop down box. Every time a user clicks on each category_name
, it will show up all jobs(CS_JOBS)
in each category. CS_JOBS
consists of job_order_number
, location
, date_close
..etc..