Timothy
Kylie Jenner
- Sep 25, 2013
- 674
- 79
I want to make it to were I can purchase like 5 thrones using vip_points but I don't know how, I can do it so u can purchase vip and credits but how do I do this?
CODE:
<?php
if (isset($_POST['throne']))
{
$vip_points = mysql_result(mysql_query("SELECT `vip_points` FROM `users` WHERE `id`='" . $_SESSION['user']['id'] . "'"), 0);
if ($vip_points < 500)
{
echo "<div style='margin-top: -12px; background: red; color: #fff; border-radius: 5px; padding: 5px; margin-bottom: -10px;'><font size='1'><center>Not enough points.</center></font></div>";
}
else
{
mysql_query("UPDATE `users` SET `vip_points`=`vip_points` - 500, credits = credits+200000 WHERE `id`='" . $_SESSION['user']['id'] . "' AND `vip_points` > - 500");
echo "<div style='margin-top: -12px; background: green; color: #fff; border-radius: 5px; padding: 5px; margin-bottom: -10px;'><font size='1'><center>Successful Purchase.</center></font></div>";
echo '<script type="application/javascript">slideDown();</script>';
echo '<script type="text/javascript">$(document).ready(function(){ $("#vpoints").html("Dine VIP-POENG: <strong>'.($vip_points-500).'</strong>"); });</script>';
}
}
?>
thanks in advanced
CODE:
<?php
if (isset($_POST['throne']))
{
$vip_points = mysql_result(mysql_query("SELECT `vip_points` FROM `users` WHERE `id`='" . $_SESSION['user']['id'] . "'"), 0);
if ($vip_points < 500)
{
echo "<div style='margin-top: -12px; background: red; color: #fff; border-radius: 5px; padding: 5px; margin-bottom: -10px;'><font size='1'><center>Not enough points.</center></font></div>";
}
else
{
mysql_query("UPDATE `users` SET `vip_points`=`vip_points` - 500, credits = credits+200000 WHERE `id`='" . $_SESSION['user']['id'] . "' AND `vip_points` > - 500");
echo "<div style='margin-top: -12px; background: green; color: #fff; border-radius: 5px; padding: 5px; margin-bottom: -10px;'><font size='1'><center>Successful Purchase.</center></font></div>";
echo '<script type="application/javascript">slideDown();</script>';
echo '<script type="text/javascript">$(document).ready(function(){ $("#vpoints").html("Dine VIP-POENG: <strong>'.($vip_points-500).'</strong>"); });</script>';
}
}
?>
thanks in advanced