Jump to content

Parse error


3raser

Recommended Posts

Seems I always get these errors.....but I've looked over the code several times studying it. I can't seem to figure out the problem. :/

 

Parse error: parse error in C:\wamp\www\project11\clan_pages.php on line 40

 

<?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);

$clan = $_GET['id'];

         if(!$clan) {
      echo "You haven't chosen a page to view! <a href='index.php'>Home</a>";
     } else {
	  if ($get_other = mysql_query("SELECT clan_name FROM clans WHERE clan_id='$clan'")) {
	  $check = mysql_num_rows($get_other);
	  if(!$check) {
	   echo "Sorry! No clan exists with that ID.";
	  } else {
	     
		     $extract = mysql_query("SELECT * FROM clans WHERE clan_id='$clan'"); 
			 while ($row = mysql_fetch_assoc($extract))
			   {
			    $clan_name = $row['clan_name'];
				$clan_points = $row['clan_points'];
				$clan_starter = $row['clan_starter'];
				echo "Clan name: ". $clan_name ." Clan Points: ". $clan_points ."  Clan leader: ". $clan_starter ."";
			   }
		//get members
		$get_members = mysql_query("SELECT clan FROM users WHERE clan='$clan'");
		$count = mysql_num_rows($get_members);
		echo "<br/><br>There is a total of ". $count ." members in the clan!<br/><br/>";
		//get user name
		$get_member = mysql_query("SELECT username FROM users WHERE clan='$clan'");
	    while ($get = mysql_fetch_assoc($get_member))
		  {
		    echo "The user ". $row['username']; ." is in the clan.";
		  }
	  }
	 }
        }
?>

Link to comment
https://forums.phpfreaks.com/topic/204997-parse-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.