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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.