3raser Posted June 16, 2010 Share Posted June 16, 2010 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 More sharing options...
mrMarcus Posted June 17, 2010 Share Posted June 17, 2010 Note the ; after $row['username']; Get rid of it: echo "The user ". $row['username'] ." is in the clan."; Link to comment https://forums.phpfreaks.com/topic/204997-parse-error/#findComment-1073187 Share on other sites More sharing options...
3raser Posted June 17, 2010 Author Share Posted June 17, 2010 Oh, didn't know that would be the problem causing it. Thank you. Link to comment https://forums.phpfreaks.com/topic/204997-parse-error/#findComment-1073193 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.