Jump to content

Parse Error: Syntax Error, Unexpected T_While ?help?


Hypersource

Recommended Posts

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.

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.