First of all, the system I am working on is a virtual HR system. Now, I have this profile.php page where the form for the applicant is located. The form is consists of her/his basic profile and requires him/her to set the skills the applicant has. When the applicant press the submit button, it will go to test.php where the page will display the possible jobs that the applicant is qualified into based on the skills of the applicant that he/she entered in the profile.php
.
Now, I'm having this error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Specialist WHERE fname=Jamie' at line 2
Here's the code in the test.php where I'm trying to update and show the job column value in employee table.
$last = mysql_query("SELECT * from employee ") or die(mysql_error());
echo "<table border='0' cellpadding='15' text-align = 'center' >";
echo "<tr>";
echo "<th>Name</th>";
echo "</tr>";
while($row2 = mysql_fetch_array( $last )){
$nym = $row2['fname'];
}
$result = mysql_query("SELECT * FROM employee as t1,jobs as t2
where t1.skills = t2.skills ") or die(mysql_error());
while($row = mysql_fetch_array( $result )){
$jt = $row['jobtitle'];
$hey = mysql_query("UPDATE employee
SET job=$jt
WHERE fname=$nym")
or die(mysql_error());
echo '<th><b><font color="#663300">' . $row['job'] . '</font></b><br></th>';
}
Here's the snapshot of my employee database http://snag.gy/i7pw6.jpg