Jump to content

Parse error 2


3raser

Recommended Posts

I'm just laughing at my dumbness......I seriously just need to stop working with PHP. I KEEP GETTING THESE PARSE ERRORS EVERYTIME I DO SOMETHING?!

 

Parse error: parse error in C:\wamp\www\project11\join.php on line 32

 

<?php
session_start();
$session = $_SESSION['user'];

$mysql_host = "localhost";
$mysql_username = "root";
$mysql_password = "";
$mysql_database = "project11";

mysql_connect($mysql_host, $mysql_username, $mysql_password);
mysql_select_db($mysql_database);

$id = $_GET['id'];

   if(!$id) {
     echo "You must select a clan to join first! <a href='index.php'>Home</a>";
   } else {
     $extract = mysql_query("SELECT clan FROM users WHERE username='$session'");
 while ($row = mysql_fetch_assoc($extract)) {
      $exist = $row['clan'];
   }
   
   if (!$clan) {
  
   if($does_it_exist = mysql_query("SELECT clan_name FROM clans WHERE clan='$id'")) {
     $check = mysql_num_rows($does_it_exist);
	  if(!$check) {
	    echo "Sorry, but no clan exists with the ID code of ". $id ."! <a href='index.php'>Home</a>";
	  } else {
	  mysql_query("INSERT INTO requests VALUES ('', '$session', '$id')");
	  echo "Your request has been sent to the clan leader. Please wait for it to be approved!";
   } else {
     echo "Sorry, an error occured.";
   } else {
    echo "Sorry, your already in a clan! <a href='index.php'>Home</a>";
   }
   }

?>

Link to comment
Share on other sites

Fixed a few of the brackets.

 

<?php
session_start();
$session = $_SESSION['user'];

$mysql_host = "localhost";
$mysql_username = "root";
$mysql_password = "";
$mysql_database = "project11";

mysql_connect($mysql_host, $mysql_username, $mysql_password);
mysql_select_db($mysql_database);

$id = $_GET['id'];

   if(!$id) {
     echo "You must select a clan to join first! <a href='index.php'>Home</a>";
   } else {
     $extract = mysql_query("SELECT clan FROM users WHERE username='$session'");
 while ($row = mysql_fetch_assoc($extract)) {
      $exist = $row['clan'];
   }
   
   if (!$clan) {
  
   if($does_it_exist = mysql_query("SELECT clan_name FROM clans WHERE clan='$id'")) {
     $check = mysql_num_rows($does_it_exist);
	  if(!$check) {
	    echo "Sorry, but no clan exists with the ID code of ". $id ."! <a href='index.php'>Home</a>";
	  } else {
	  mysql_query("INSERT INTO requests VALUES ('', '$session', '$id')");
	  echo "Your request has been sent to the clan leader. Please wait for it to be approved!";
   } else {
     echo "Sorry, an error occured.";
   } else {
    echo "Sorry, your already in a clan! <a href='index.php'>Home</a>";
   }
   }
   }
   }
?>

 

But still get

 

Parse error: parse error in C:\wamp\www\project11\join.php on line 32

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.