Thanks for that.
I have amended the code however I am still struggling to get the full code to work once I try and use a while statement.
Here is the code, if anyone can help me that would be a great help. I have slowly let my PHP skills slip and I can't code for toffee at the moment - who said ASP was a superior language (grr).
<?php
//Get variables from search.php
$title = $HTTP_POST_VARS['title'];
$location = $HTTP_POST_VARS['location'];
$date = $HTTP_POST_VARS['date'];
//Load Database Connection & DB details
include("config.php");
//SQL query
$sql = "SELECT jobid, date, description, location, salary FROM job where description = '$title'";
//Execute SQL and exit if failure
$sql_result = mysql_query($sql) or die('Sorry the query could not be executed');
$num_rows = mysql_num_rows($sql_result);
if ($num_rows == 0)
{
echo 'Sorry you search did not return any results';
exit;
}
while ($row = mysql_fetch_array($sql_result)){
$jobid = $row["jobid"];
$date= $row["date"];
$desc = $row["description"];
$location = $row["location"];
$salary = $row["salary"];
echo '<table><tr><td>Job ID: $jobid</td></tr>';
echo '<tr><td>Date: $date</td></tr>';
echo '<tr><td>Description: $desc</td></tr>';
echo '<tr><td>Location: $location</td></tr>';
echo '<tr><td>Salary: £$salary</td></tr></table>';
echo 'For more details, please click <a href=result_details.php?jobid=$jobid>here</a>';
?>
I am getting the following error:
Parse error: parse error, unexpected $end in d:\web\result.php on line 37