hi there,
thank you once more for you help.i understand what you said.
thanks for a lesson.
i tried to use it in my code, it did not help.
i got parse error. at line 225. I have put comment where the error is.
Could it be the problem cause i am not posting to catalog a quantity.
here is the structure of my sql table: as you can see from table quantity = qty
how can i insert quantity here ?
how can i solve this ? please help...
CREATE TABLE `catalog` (
`session` varchar(200) NOT NULL default '',
`product` int(11) NOT NULL default '0',
`qty` int(11) NOT NULL default '0',
`member` int(11) NOT NULL default '0',
`price` decimal(10,2) NOT NULL default '0.00'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Izvoz <i>(dump)</i> podataka tablice `catalog`
--
INSERT INTO `catalog` VALUES ('ff964f3aa890361e3b5bc4618111465a', 2, 0, 0, 0.00);
INSERT INTO `catalog` VALUES ('ff964f3aa890361e3b5bc4618111465a', 2, 0, 0, 0.00);
if(isset($_GET['remove'])){
$queryp = mysql_query("SELECT * FROM `catalog` WHERE session='$ses' AND product = '".$_GET['remove']."' LIMIT 1");
$item = mysql_fetch_array($queryp);
if($item['qty'] >=2){
// Parse error: parse error on line 225
// this is line 225
$queryq = mysql_query("UPDATE `catalog` SET qty = '".$item['qty']-1."' WHERE session = '$ses' AND product = '".$_GET['remove']."'");
}
else{
$queryq = mysql_query("DELETE FROM `catalog` WHERE session = '$ses' AND product = '".$_GET['remove']."'");
}
if(!$queryq){
// echo error
}
else{
// Show your updated stuff, or just skip this
}
}