Jump to content

Parse error - help needed


Butch_ben

Recommended Posts

hiim creating an online mafia game using php and mysql and im not sure how to perform this code

<?$username = $_SESSION["username"];$query_general ="SELECT * FROM users WHERE username ='$username'";$object_general = mysql_fetch_object(mysql_query($query_general));$points=$object_general->points;if($_POST[crime] == 1 && $points >= '0'){echo"<center> Success! <br> You set up your stool and went un noticed for the whole day. <br> You earned a nice sum of £ $crime1 </center>";}else{ echo"<center> Failure! <br> If you cant do that crime you might as well suicide now</center>";} if ($result == 'true' "$gold"+"$crime1") ?>

the error is

 if ($result == 'true' "$gold"+"$crime1")

i need the code to add money ($crime1) to the money on their user area ($gold) if they succeed in the crime and also add points to their user ($points)can somebody please help me with this? i can elaberate more if neededthanks

Link to comment
Share on other sites

Addition is pretty much straight forward, it will just add two numbers, but we have to check if it goes inside the if loop... check for the value of $result and see if its "true"... I dont see anyother problem if its a normal sum of two numbers.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...