I have the following PHP code. I'm getting the following error 'Parse error: parse error in /home/tickets/public_html/addagent.php on line 31'. Line 31 is market with a comment below. I have gone over this a dozen times, and I've had two other developers in the office browse it over with me. Can you see what is wrong here?
<?php
// Include the init
include 'init.php';
// Check all required values
if ($first == '') {
$error .= '- First Name is Required.<br>';
};
if ($email == '') {
$error .= '- Email Address is Required.<br>';
};
if ($password == '') {
$error .= "- Password is Required.<br>';
};
// Produce error
if ($error != '') {
echo '<p>The following errors were encountered:</p>';
echo "<p>$error</p>"; // It says there is an error on this line (31).
exit;
};
// Get next id
$agentid = getid();
// Connect to MySQL database
$db = mysql_connect ($host, $user, $pass);
// Run insert query
$query = "INSERT INTO agents (agentid, first, last, company, title, phonenum,
extension, faxnum, email, password) VALUES ($agentid, '$first', '$last', '$company', '$title',
'$phonenum', '$extension', '$faxnum', '$email', '$password')";
mysql_db_query ('tickets', $query, $db);
// Show results
echo 'Agent added.';
?>