0

Hello all,

I am having some trouble with a ; in some php. The code is below with the problem commented out. I have no idea what I am doing wrong and I would like to know why.

Many thanks,

<?php

	require("init.inc.php");
	
	global $_MYSQL_DB;
	global $_MYSQL_USER;
	global $_MYSQL_PASS;
	global $_MYSQL_HOST;
	
	$connection = mysql_connect($_MYSQL_HOST, $_MYSQL_USER, $_MYSQL_PASS, $_MYSQL_DB)
	or
	die("Fail to connect");
	
	echo("connection is good");
	
	$sql = "SELECT * FROM MEMBER";
	$results = mysql_query($sql);
	
	while($row = mysql_fetch_array($results))
	(
		$mid = stripslashes($row['MID']);		//<----geting an error here
		//Parse error: syntax error, unexpected ';' in /home/ACC.joshid2/public_html/355/3p2/p3p2.php on line 21
		$pwd = stripslashes($row['Password']);
		$fname = stripslashes($row['First Name']);
		$lname = stripslashes($row['Last Name']);
		$address = stripslashes($row['Address']);
		$email = stripslashes($row['Email']);
		$bal = stripslashes($row['Balance']);
		
		print($mid\t$pwd\t$fname\t$lname\t$address\t$email\t$bal);
		echo ('<br>');
		
	)//end loop
	
	mysql_free_result($results);
	mysql_close($connection);
?>
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by chrishea
0

For the While, you used open and closed brackets instead of open and closed braces {}.
One you fix that, you'll have an error on line 30 because you have strings without any quotes. You could put the whole string in double quotes and it will work.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.