Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2008
    Posts
    680
    Thanks
    114
    Thanked 2 Times in 2 Posts

    Unfound Parse Error

    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 Code:
    <?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));  
         }
    ?>
    Last edited by CoolAsCarlito; 11-30-2010 at 02:19 AM.

  • #2
    New Coder
    Join Date
    Sep 2010
    Posts
    77
    Thanks
    13
    Thanked 1 Time in 1 Post
    You're not closing the first bracket on the if isset line.

  • Users who have thanked zachatk for this post:

    CoolAsCarlito (11-30-2010)

  • #3
    Regular Coder
    Join Date
    Jun 2008
    Posts
    680
    Thanks
    114
    Thanked 2 Times in 2 Posts
    Thank you. Missed the obvious.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •