This form submits to two different tables (or rather it is supposed to 😃 ) based on the npc_id.
I am getting the error
Parse error: parse error, unexpected T_VARIABLE in /home/wowdesi/public_html/forms/add_npc.php on line 29
if(isset($_POST['submit'])){// handle the form
// Connect to the database.
require_once ('../incl/mysql_connect.php');
// Query the database.
$npc_name= mysql_real_escape_string($_POST['npc_name']);
$sub_name= mysql_real_escape_string($_POST['sub_name']);
$side = mysql_real_escape_string($_POST['side']);
$npc_level = mysql_real_escape_string($_POST['npc_level']);
$npc_rank = mysql_real_escape_string($_POST['npc_rank']);
$npc_type = mysql_real_escape_string($_POST['npc_type']);
$npc_family = mysql_real_escape_string($_POST['npc_family']);
$npc_value_gold = mysql_real_escape_string($_POST['npc_value_gold']); //Line 29
$npc_value_copper = mysql_real_escape_string($_POST['npc_value_copper']);
$quest_relations = mysql_real_escape_string($_POST['quest_relations']);
$updated = mysql_real_escape_string($_POST['updated']);
// The insert condition.
$query = "INSERT INTO npc_beastiary (npc_id, npc_name, sub_name, side, npc_level, npc_rank, npc_type, npc_family, npc_value_gold, npc_value_silver, npc_value_copper, quest_relations, updated) VALUES
('', '$npc_name', '$sub_name', '$side', '$npc_level', '$npc_rank', '$npc_type', '$npc_family', '$npc_value_gold', '$npc_value_silver', '$npc_value_copper', '$quest_relations', NOW()) ";
$result = @mysql_query ($query) or die ("could not execute query."); // Run the query.
$npc_id = mysql_insert_id()
// there can be a total of 4 related npc_id to zone_id/area_id's
$query = "INSERT INTO npc_locations (npcloc_id, npc_id, zone_id, area_id, coordinate) VALUES
('$npcloc_id', ' $npc_id', '$zone_id', '$area_id', '$coordinate'),
('$npcloc_id', '$npc_id', '$zone_id', '$area_id', '$coordinate'),
('$npcloc_id', '$npc_id', '$zone_id', '$area_id', '$coordinate'),
('$npcloc_id', '$npc_id', '$zone_id', '$area_id', '$coordinate')
";
$result = @mysql_query ($query)or die ("could not execute query."); // Run the query.
if ($result) { // If it ran OK.
// Send an email, if desired.
echo '<table width=95% align=center class=tableOutline>
<tr><td>
<p>Thank you for adding this NPC!</p>
<p><a href=/forms/add_npc.php target=_self>Add another NPC</a></p>
</td></tr></table>';
include ('../incl/footer.html'); // Include the HTML footer.
exit();
} else { // If it did not run OK.
// Send a message to the error log, if desired.
echo '<table width=95% align=center class=tableOutline>
<tr><td><p>Your information could not be registered due to a system error. We apologize for any inconvenience.</p></td></tr></table>
';
}
mysql_close(); // Close the database connection.
} // End of the main Submit conditional.