i cannot seem to find where to add the line to take 100 crystals from the user for using the daily random item giver can anyone implement it for me, code is shown below, im sorry for all the issues im having only new to this stuff
<?php
include_once('globals.php');
$sql = "SELECT * FROM `random_items` WHERE `user` = '{$ir['userid']}'";
$run = mysql_query($sql, $c) or die (mysql_error());
if (mysql_num_rows($run) == 0)
{
$amount = mt_rand(4);
echo '<p>You have Recieved ' . $amount . ' </p>
<p>The items you have been given, are:</p>
<ul>';
$sql = "SELECT `itmid`,`itmname` FROM `items` WHERE `itmbuyprice` < 9000 AND `itmbuyable` = 1 ORDER BY RAND() LIMIT $amount";
$run = mysql_query($sql, $c) or die (mysql_error());
while ($item = mysql_fetch_assoc($run))
{
echo '<li>1x ' . htmlentities($item['itmname'], ENT_QUOTES, "UTF-8") . '</li>';
item_add($ir['userid'], $item['itmid'], 1);
}
echo '</ul>';
}
else
{
echo '<p>You have already claimed your free items today.</p>';
}
$h->endpage();