...

View Full Version : Resolved Unfound Parse Error



CoolAsCarlito
11-30-2010, 01:05 AM
I keep getting a parse error and after looking through my code and trying to debug it I'm not seeing anything. I know it normally means a missing semi colon or something because it says its on line 41 which is the end of the file.


<?php

// Include the database page
require ('../inc/dbconfig.php');

if (isset($_POST['submitcharacter'])) {
$charactername = mysqli_real_escape_string($dbc, $_POST['charactername']);
$charactershortname = mysqli_real_escape_string($dbc, $_POST['charactershortname']);
$sortorder = mysqli_real_escape_string($dbc, $_POST['sortorder']);
$style = mysqli_real_escape_string($dbc, $_POST['style']);
$status = mysqli_real_escape_string($dbc, $_POST['status']);
$alignment = mysqli_real_escape_string($dbc, $_POST['alignment']);
$division = mysqli_real_escape_string($dbc, $_POST['division']);

$query = "INSERT INTO `characters` (charactername, charactershortname, status_id, style_id, division_id, alignment_id, sortorder, creator_id, datecreated) VALUES ('$charactername','$charactershortname','$status','$style','$division', '$alignment', '$sortorder', 1, NOW())";
mysqli_query($dbc, $query);
$query_id = mysqli_insert_id($dbc);
$query1 = "INSERT INTO `allies` (character_id) VALUES (".$query_id.")";
mysqli_query($dbc, $query1) or die(mysqli_error($dbc));
$query2 = "INSERT INTO `rivals` (character_id) VALUES (".$query_id.")";
mysqli_query($dbc, $query2) or die(mysqli_error($dbc));
if ($style == 1) {
$query3 = "INSERT INTO `singles` (character_id) VALUES (".$query_id.")";
mysqli_query($dbc, $query3) or die(mysqli_error($dbc));
} elseif ($style == 2) {
$query4 = "INSERT INTO `tagteams` (character_id) VALUES (".$query_id.")";
mysqli_query($dbc, $query4) or die(mysqli_error($dbc));
} elseif ($style == 3) {
$query5 = "INSERT INTO `managers` (character_id) VALUES (".$query_id.")";
mysqli_query($dbc, $query5) or die(mysqli_error($dbc));
} elseif ($style == 4) {
$query6 = "INSERT INTO `stables` (character_id) VALUES (".$query_id.")";
mysqli_query($dbc, $query6) or die(mysqli_error($dbc));
} elseif ($style == 5) {
$query7 = "INSERT INTO `referees` (character_id) VALUES (".$query_id.")";
mysqli_query($dbc, $query7) or die(mysqli_error($dbc));
} else {
$query8 = "INSERT INTO `staff` (character_id) VALUES (".$query_id.")";
mysqli_query($dbc, $query8) or die(mysqli_error($dbc));
}
?>

zachatk
11-30-2010, 01:42 AM
You're not closing the first bracket on the if isset line.

CoolAsCarlito
11-30-2010, 03:20 AM
Thank you. Missed the obvious.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum