Hi I'm relatively new to PHP and am creating a recruitment website. On my vacancies page I have a table which is populated with the vacancies in the database. I want the user to be able to click a row and be taken to the Vacancy info page. Here is my current code
As you see it's a plain table with no links. I'm unsure where to insert my href code linking them to the info page. Any help would be appreciated thanks!PHP Code:<?php
include("connection.php"); //Connect to the Recruitment database
$conn=@mysql_connect(localhost,$user,$pass);
$rs=@mysql_select_db("recruitment") or die( "Unable to select database");
$sql="SELECT CompanyTitle, Title, RoleDescription, AnnualSalary, EndDate FROM vacancy ORDER BY CompanyTitle";
$result=mysql_query($sql)or die("Insert Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print " <table> \n";
print " <tr> \n";
while ($field = mysql_fetch_field($result))
{
print " <th>$field->name</th> \n";
}
print " </tr> \n";
while($row= mysql_fetch_assoc($result))
{
print " <tr> \n";
foreach ($row as $name => $value)
{
print " <td>$value</td>
\n";
}
print " </tr> \n";
}
print " </table> \n";
mysql_close();
?>


Reply With Quote
Bookmarks