Hi all,

I know I've asked this before and wouldn't be asking again if I had the
email that you people replied back with. Windows took a you know what on me
and I had to format the hard drive.

Anyway here is what I have.

This is items.php:
<form action='buyitem.php' method='post'>
$query = "SELECT id, image, name, quantity, price FROM
{$config["prefix"]}_items where id = 1";
$ret = mysql_query($query);
$return = mysql_fetch_array($ret);

echo "<input type='image' src='images/blueholo.gif'><br>";

echo "<b>$return[name]</b><br>";
echo "Quantity $return[quantity]<br>";
echo "Cost: $return[price] SC<br>";
echo "<input type='hidden' name='ItemID' value='$id'>";

What I need to accomplish  is that when the submit button is clicked the
quantity is subtracted by 1 and then the item is placed in the users item
list in mysql.

This is what I have in buyitem.php but I cant seem to get it to work.
$return["quantity"]=("UPDATE {$config["prefix"]}_items set quantity =
quantity - 1 WHERE id = '$ItemID'");

Would someone be kind enough to help with this?

Thanks for all your help so far.
And thanks in advance.

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to