[SOLVED] Stumped -- take a look please?

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
siefkencp
Forum Commoner
Posts: 69
Joined: Thu Dec 16, 2004 8:50 am

[SOLVED] Stumped -- take a look please?

Post by siefkencp »

When I run this code I get the following error...
Parse error: parse error in /var/www/html/admin/admissions/name.php on line 39
Line 39 is the very end... Any one got any suggestions???

Thanks,
Chris

Code: Select all

<?php

include '/var/www/html/phplib/mysql_connect.php';
$name = explode(" ", $search);

foreach ($name as $key => $value){
	print "Searched for: ";
	print "$name[$key] <br><br>";
	
	$query_array = mysql_query ("SELECT people_code_id FROM admissions_stats WHERE first_name = '$name[$key]' OR last_name = '$name[$key]'")
	or die ("Not Found");
	
	while ($final_array = mysql_fetch_array($query_array, MYSQL_ASSOC)){
		$id = $final_array['people_code_id'];
		
		$detail_array = mysql_query ("SELECT * FROM admissions_stats WHERE people_code_id = '$id'")
		or die ("Not good" . mysql_error());
		
		$fin_detail_array = mysql_fetch_array($detail_array, MYSQL_ASSOC);
		
		$status_array = mysql_query ("SELECT app_status FROM admitxmascard WHERE people_code_id = '$id'")
		or die ("Not good" . mysql_error());

		$stat_detail_array = mysql_fetch_array($status_array, MYSQL_ASSOC);
	
		$firstname = $fin_detail_array['first_name'];
		$lastname = $fin_detail_array['last_name'];
		$status = $stat_detail_array['app_status'];
		
		print "<a href="power_id.php?power_id=$id">";
		print "$lastname, $firstname</a>";
			if ($status != '') {
			print "  -- Status: $status";
			}
		print "<br><br>";
		} 
include '/var/www/html/phplib/close.php';

?>
[/quote]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

mismatch of opening and closing braces: {}

hint: the foreach.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Your missing a closing } to go with this line:

Code: Select all

foreach ($name as $key => $value){
[edit] Beaten to it :o
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

mwahahahahhahah ;) :twisted:
siefkencp
Forum Commoner
Posts: 69
Joined: Thu Dec 16, 2004 8:50 am

Post by siefkencp »

AHH HA i knew it was some dumb semi-colon or brace... thanks for the extra eyes...

Chris
Post Reply