and i was trying to make it where if the user have the point to buy the apps they can.
here my script
<?php
include("database.php");
session_start();
$result = mysql_query("SELECT * FROM users WHERE username='".$_SESSION['Username']."'");
$row = mysql_fetch_array($result);
if($row['Points'] =="100"){
echo"<br/><font color=green>Thank you for buying</font>";
}
else{
echo"<br/><font color=red>You don't have enough points</font>";
}
?>
Re: the code posted, I'd be dealing with functions that calculate points before and after, as well as taking into account the instance of having more points than needed. The way it is now, it may run, but I don't think the correct items and appropriate outputs are being associated. Hence, it probably will not operate like a shop.
All your code does is check if the user's points are exactly equal to 100. What you need to do is as Lim said and check what the user's points are in relation to what the cost of the item in the shop is, subtract the appropriate amount of they have enough points and update the database tables so that the users points have been deducted properly and they have the app or whatever they bought.
It's my job to help the next generation, and set a good example for them. And for that I'll gladly lay down my life.