Below is my job post code, it cannot post into database... WHAT IS THE PROBLEM OF IT??
[PHP]<?php
session_start();
ob_start();
//connect to server and select database
$conn=mysql_connect("localhost", "root", "") or die (mysql_error());
mysql_select_db("ums e-job portal", $conn) or die(mysql_error());
//If the form was submitted, process it.
if (isset($_POST['submit'])){
$problem=FALSE;
//check for empty value in each mandatory field.
if (empty($_POST['jobTitle'])||empty($_POST['jobType'])||empty($_POST['jobCategory'])||empty($_POST['jobPosition'])||empty($_POST['jobLocation'])||empty($_POST['mRequirement'])||empty($_POST['jobDescription'])){
$problem=TRUE;
echo '<p>Please make sure you enter all the required fields!</p>';
}
//if no problem then insert values into the abstract table in the database.
if (!$problem){
$query = "INSERT INTO job values ( '', '$_SESSION[company_ID]', '$_SESSION[companyName]', '$_SESSION[contactName]' , '$_SESSION[emailAdd]', '$_SESSION[contactNum]', '$_SESSION[contactAdd]', '$_POST[jobTitle]', '$_POST[jobType]', '$_POST[jobCategory]', '$_POST[jobPosition]', '$_POST[jobLocation]', '$_POST[mRequirement]', '$_POST[jobDescription]', now() )";
if(mysql_query($query)){
echo 'The job has been posted.<br>';
exit ();
}else{
echo 'The job could not be submitted. Because:'.mysql_error();
}
}#end of insert values if.
}#end of submit if...
// construct SQL statement
$sql =mysql_query("SELECT * FROM company WHERE company_ID='{$_SESSION['company_ID']}'");
$rows=@mysql_fetch_array($sql)
?>[/PHP]
[HTML]<form name="act" method="post" action="jobPost.php">
<table width="600" border="0">
<tr>
<td colspan="3"><font color="#000000"><strong>COMPANY CONTACT INFORMATION</strong></font></td>
</tr>
<tr>
<td width="217"><font color="#000000">Company Name</font><font color="#000000"> </font></td>
<td width="30"><div align="center"><strong>:</strong></div></td>
<td width="339"><input name="companyName" type="text" maxlength="30" value="<? echo $rows['companyName'];?>"></td>
</tr>
<tr>
<td width="217"><font color="#000000">Contact Name</font><font color="#000000"> </font></td>
<td width="30"><div align="center"><strong>:</strong></div></td>
<td width="339"><input name="contactName" type="text" maxlength="30" value="<? echo $rows['contactName'];?>"></td>
</tr>
<tr>
<td><font color="#000000">Email Address</font></td>
<td><div align="center"><strong>:</strong></div></td>
<td><input name="emailAdd" type="text" maxlength="50" value="<? echo $rows['emailAdd'];?>"></td>
</tr>
<tr>
<td><font color="#000000">Contact Number</font></td>
<td><div align="center"><strong>:</strong></div></td>
<td><input name="contactNum" type="text" maxlength="11" value="<? echo $rows['contactNum'];?>"></td>
</tr>
<tr>
<td><font color="#000000">Contact Address</font></td>
<td><div align="center"><strong>:</strong></div></td>
<td><textarea name="contactAdd" cols="30" rows="3"><? echo $rows['contactAdd'];?></textarea> </textarea>
</td>
</tr>
<tr>
<td colspan="3"><div align="center"></div></td>
</tr>
<td colspan="3"><font color="#000000"><strong>JOB INFORMATION</strong></font></td>
<tr>
<td width="217"><font color="#000000">Job Title</font><font color="#000000"> </font></td>
<td width="30"><div align="center"><strong>:</strong></div></td>
<td width="339"><input name="jobTitle" type="text" maxlength="30"></td>
</tr>
<tr>
<td><font color="#000000">Job Type</font></td>
<td><div align="center"><strong>:</strong></div></td>
<td><select name="jobType">
<option selected></option>
<option>Permanent/Full Time</option>
<option>Temporary/Part Time</option>
<option>Internships</option>
</select></td>
</tr>
<tr>
<td><font color="#000000">Job Category</font> </td>
<td><div align="center"><strong>:</strong></div></td>
<td><select name="jobCategory">
<option selected></option>
<option>Accounting</option>
<option>Advertising</option>
<option>Agriculture</option>
<option>Banking</option>
<option>Biotechnology</option>
<option>Chemical Eng</option>
<option>Chemistry</option>
<option>Clerical/Admin</option>
<option>Customer Service</option>
<option>Education</option>
<option>Electronics Eng</option>
<option>Food Tech</option>
<option>General Workers</option>
<option>Graphics</option>
<option>Healthcare</option>
<option>Hotel/Food</option>
<option>Human Resources</option>
<option>IT/Computer</option>
<option>Journalist/Editor</option>
<option>Manufacturing</option>
<option>Marketing</option>
<option>Mechanical Eng</option>
<option>Media/Entertain</option>
<option>Personal Care</option>
<option>Publishing</option>
<option>Purchasing</option>
<option>Quantity Survey</option>
<option>Sales</option>
<option>Science/Tech</option>
<option>Secretarial</option>
<option>Social Services</option>
<option>Training</option>
<option>Others</option>
</select></td>
</tr>
<tr>
<td><font color="#000000">Job Position Level</font></td>
<td><div align="center"><strong>:</strong></div></td>
<td><select name="jobPosition">
<option selected></option>
<option>Senior Manager</option>
<option>Manager</option>
<option>Senior Executive</option>
<option>Junior Executive</option>
<option>Non-Executive</option>
<option>Fresh/Entry Level</option>
<option>Others</option>
</select></td>
</tr>
<tr>
<td><font color="#000000">Job Location</font></td>
<td><div align="center"><strong>:</strong></div></td>
<td><select name="jobLocation">
<option selected></option>
<option>Perlis</option>
<option>Penang</option>
<option>Kedah</option>
<option>Perak</option>
<option>Kelantan</option>
<option>Terengganu</option>
<option>Pahang</option>
<option>Selangor</option>
<option>Kuala Lumpur</option>
<option>Negeri Sembilan</option>
<option>Melaka</option>
<option>Johor</option>
<option>Labuan</option>
<option>Sabah</option>
<option>Sarawak</option>
</select></td>
</tr>
<tr>
<td colspan="3"><font color="#000000">Minimal Requirement</font></td>
</tr>
<tr>
<td height="75" colspan="3"> <textarea name="mRequirement" cols="66" rows="4"></textarea></td>
</tr>
<tr>
<td colspan="3"><div align="center"></div></td>
</tr>
<tr>
<td colspan="3">Job Description</td>
</tr>
<tr>
<td colspan="3"><font color="#000000">
<textarea name="jobDescription" cols="66" rows="4"></textarea>
</font></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="Post Job" type="submit" id="Post Job" value="Post Job">
</div></td>
<td><div align="center">
<input type="reset" name="Reset" value="Reset">
</div></td>
</tr>
</table>
<p> </p>
</form>[/HTML]