Hypersource Posted December 29, 2012 Share Posted December 29, 2012 Heres the error: Parse error: syntax error, unexpected T_WHILE in ****/*/*.php on line 17 The code: <?PHP include 'connect.php'; $tik=$_SESSION['user_name']; $amount= $_POST['amount']; if($amount) { $user= MYSQL_QUERY("SELECT * FROM users WHERE user_name='$tik'")or die(mysql_error); WHILE($row=MYSQL_FETCH_ARRAY($user)) { $club=$row['club']; $cash=$row['cash']; } $c= MYSQL_QUERY("SELECT * FROM club WHERE name='$club' ")or die(mysql_error); WHILE($row=MYSQL_FETCH_ARRAY($c))//Problem Line { $till=$row['till']; $owner=$row['$owner']; } $till=$till+$amount; $cash=$cash-$amount; if($amount > 0 AND $cash > 0) { $epic=mysql_query("UPDATE club SET till='$till' WHERE name='$club'") or die(mysql_error()); $epic=mysql_query("UPDATE users SET cash='$cash' WHERE user_name='$tik'") or die(mysql_error()); header( 'Location: club.php' ); } } } ?> I have know idea whats wrong with the loop. Link to comment https://forums.phpfreaks.com/topic/272488-parse-error-syntax-error-unexpected-t_while-help/ Share on other sites More sharing options...
Pikachu2000 Posted December 29, 2012 Share Posted December 29, 2012 I'm not able to make it produce that specific error, but: die( mysql_error() ); not die(mysql_error). I also get an error that indicates too many closing curly braces at the end. Is that the actual code that's giving the error? Link to comment https://forums.phpfreaks.com/topic/272488-parse-error-syntax-error-unexpected-t_while-help/#findComment-1402054 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.