I am building a table on a wordpress site that displays data that is sorted from one table.
What I cannot get right is to change the title to a URL, that is changeable (slug) from the same db.
The basic url stays the same only the slug changes
ie wwww.thesite.com/job/view/ — and then the slug.
Here is my code so far.
function dbTEST($atts, $content = null) {
// Get all the data from the "job board" table
$result = mysql_query("SELECT * FROM wpjb_job WHERE job_country='72' ORDER BY job_title")
or die(mysql_error());
echo "<table border='1'>";
echo "<tr> <th>Job</th> <th>Company</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
#---------- I need this job_title to url link to the job_slug
echo $row['job_title'];
echo $row['job_slug'];
echo "</td><td>";
echo $row['company_name'];
echo "</td></tr>";
}
echo "</table>";
}
Try this: