I have downloaded a prepackaged job listing script.
I need some help making it display more of the fields in the database than is in the current code. Since I am new to PHP and coding in general.... I am fuzzy on where to start...
The code in question is.....
#####################
Listing open jobs
#####################
if ($cmd =="List"){
### Get List of Open Jobs ###
$query = "SELECT DISTINCT id, location
from location, listing
WHERE location.id = listing.fk_location";
$result = mysql_db_query($database, $query, $connection) or die ("Error in query: $query. " . mysql_error());
### Check each department ###
while(list($id, $location) = mysql_fetch_row($result))
{
### Printing department ###
echo "<b>$location</b>";
### Look for jobs in each department and print as list ###
$query2 = "SELECT jcode, designation
from listing
WHERE listing.fk_location = '$id'";
$result2 = mysql_db_query($database, $query2, $connection) or die ("Error in query: $query2. " . mysql_error());
echo "";
while(list($jcode, $dsg) = mysql_fetch_row($result2))
{
echo "<li><a href=index_location.php?cmd=Details&jcode=$jcode>$dsg ($jcode)</a>";
}
echo "";
echo "<br><br><br>";
}
}
The variable names are ....
jcode,
department,
location,
salary,
responsibilities,
qualifications,
cname,
cmail,
posted
The Database is called Jobs and the table is called listing
I am confident I know how to do the echo part of it....
The problem is in my query...
I don't know how to structure the SELECT statement to get the variables correctly....
Thanks for any help....