Parse error?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

Parse error?

Post by Citizen »

When I run my script, it gives me a parse error on line 24 but I'm not seeing it... help?


Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/gamerbio/public_html/admin/arcade/installgp1.php on line 24

Code: Select all

<?php

include("../../inc/config/connect.inc");

include("header.php");

protect();

if (member_types2($VAR[4]) != '0') {
	echo "<p>Sorry, but you must be logged in as an administrator to view this area.";
}
else {

$sql="SELECT * FROM `arcade_categories` WHERE catname = 'Retro' LIMIT 1";
$result=mysql_query($sql);
$existcheck = mysql_num_rows($result);
if($existcheck == 1){

$sql = "SELECT * FROM `arcade_games` WHERE `shortname` = 'breakout'";
$result = mysql_query($sql) or die(mysql_error());
$existcheck = mysql_num_rows($result);
if($existcheck >= 1){
echo "<p>Breakout is already entered. Moving on..."
}
else{
$sql = "INSERT INTO `arcade_games` (shortname, title, description, file, width, height, miniimage, stdimage, isreverse) 
VALUES ('breakout', 'Breakout', 'Use a ball and paddle to smash your way through a series of regenerating blocks.', 'breakout.swf', '400', '400',  'breakout2.gif', 'breakout1.gif', '0')";
$result=mysql_query($sql) or die(mysql_error());
echo "<p>Congratulations, Breakout has been installed!";
}

$sql = "SELECT * FROM `arcade_games` WHERE `shortname` = 'asteroids'";
$result = mysql_query($sql) or die(mysql_error());
$existcheck = mysql_num_rows($result);
if($existcheck >= 1){
echo "<p>Asteroids is already entered. Moving on..."
}
else{
$sql = "INSERT INTO `arcade_games` (shortname, title, description, file, width, height, miniimage, stdimage, isreverse) 
VALUES ('asteroids', 'Asteroids', 'Fly your spaceship and destroy the asteroid fields to gain points.', 'asteroids.swf', '400', '346', 'asteroids2.gif', 'asteroids1.gif', '0')";
$result=mysql_query($sql) or die(mysql_error());
echo "<p>Congratulations, Asteroids has been installed!";
}

$sql = "SELECT * FROM `arcade_games` WHERE `shortname` = 'tetris'";
$result = mysql_query($sql) or die(mysql_error());
$existcheck = mysql_num_rows($result);
if($existcheck >= 1){
echo "<p>Tetris is already entered. Moving on..."
}
else{
$sql = "INSERT INTO `arcade_games` (shortname, title, description, file, width, height, miniimage, stdimage, isreverse) 
VALUES ('tetris', 'Tetris', 'Align the falloing bricks to form complete lines. A true classic.', 'tetris.swf', '400', '346', 'tetris2.gif', 'tetris1.gif', '0')";
$result=mysql_query($sql) or die(mysql_error());
echo "<p>Congratulations, Tetris has been installed!";
}

$sql = "SELECT * FROM `arcade_games` WHERE `shortname` = 'spaceinvaders'";
$result = mysql_query($sql) or die(mysql_error());
$existcheck = mysql_num_rows($result);
if($existcheck >= 1){
echo "<p>Space Invaders is already entered. Moving on..."
}
else{
$sql = "INSERT INTO `arcade_games` (shortname, title, description, file, width, height, miniimage, stdimage, isreverse) 
VALUES ('spaceinvaders', 'Space Invaders', 'Destroy the invading aliens before you perish!', 'spaceinvaders.swf', '400', '346', 'spaceinvaders2.gif', 'spaceinvaders1.gif', '0')";
$result=mysql_query($sql) or die(mysql_error());
echo "<p>Congratulations, Space Invaders has been installed!";
}

$sql = "SELECT * FROM `arcade_games` WHERE `shortname` = 'snake'";
$result = mysql_query($sql) or die(mysql_error());
$existcheck = mysql_num_rows($result);
if($existcheck >= 1){
echo "<p>Snake is already entered. Moving on..."
}
else{
$sql = "INSERT INTO `arcade_games` (shortname, title, description, file, width, height, miniimage, stdimage, isreverse) 
VALUES ('snake', 'Snake', 'Direct your snake to eat the apples. Don't eat yourself!', 'snake.swf', '400', '346', 'snake2.gif', 'snake1.gif', '0')";
$result=mysql_query($sql) or die(mysql_error());
echo "<p>Congratulations, Snake has been installed!";
}

$sql = "SELECT * FROM `arcade_games` WHERE `shortname` = 'simon'";
$result = mysql_query($sql) or die(mysql_error());
$existcheck = mysql_num_rows($result);
if($existcheck >= 1){
echo "<p>Simon is already entered. Moving on..."
}
else{
$sql = "INSERT INTO `arcade_games` (shortname, title, description, file, width, height, miniimage, stdimage, isreverse) 
VALUES ('simon', 'Simon', 'A true test of mental agility. Follow the pattern of lights and sounds for as long as you can remember them!', 'simon.swf', '500', '400', 'simon2.gif', 'simon1.gif', '0')";
$result=mysql_query($sql) or die(mysql_error());
echo "<p>Congratulations, Simon has been installed!";
}

$sql = "SELECT * FROM `arcade_games` WHERE `shortname` = 'copter'";
$result = mysql_query($sql) or die(mysql_error());
$existcheck = mysql_num_rows($result);
if($existcheck >= 1){
echo "<p>Helicopter is already entered. Moving on..."
}
else{
$sql = "INSERT INTO `arcade_games` (shortname, title, description, file, width, height, miniimage, stdimage, isreverse) 
VALUES ('copter', 'Helicopter', 'Navigate your helicopter around the obstacles and stay alive to gain points.', 'copter.swf', '400', '300', 'copter2.gif', 'copter1.gif', '0')";
$result=mysql_query($sql) or die(mysql_error());
echo "<p>Congratulations, Helicopter has been installed!";
}

echo "<p>Game Pack 1 installation complete. You should now delete this file.";
}
else{
echo "You must first add the category 'Retro' to your categories list before continuing. Add the category and reload this script.";
}
}
?>
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

Code: Select all

if ($existcheck >= 1)
{ 
echo "<p>Breakout is already entered. Moving on...";
}
You missed the line ending character. :roll:
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

Post by Citizen »

Thanks! I dont know how I missed that 8O
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

its okay

i coded for nearly 8 hours straight last night and you should what i missed

'My Error Handler' in Theory and Design
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Heh.... it's probably a good idea to indent your code inside braces ;)
Post Reply