Hi again I'm getting this message now: Supplied argument is not a valid MySQL result resource ..at the 4th line. What could be the problem now? Thx again
function AddItem($OrderID,$ProductID,$Qty) { $Datasource = new Datasource; $result = mysql_query("Select Count(*) FROM orderitemdetail WHERE Product_Id=$ProductID AND Order_Id=$OrderID"); $row = mysql_fetch_row($result); if ($row[0]>0) { $SQL1 = "UPDATE orderitemdetail SET Quantity=Quantity+$Qty ". " WHERE Product_Id=$ProductID AND Order_Id=$OrderID"; } else { $SQL1 = "INSERT INTO orderitemdetail (Order_Id, Product_Id, Quantity)". "VALUES($OrderID,$ProductID,1)"; } $QueryResult = $Datasource->QueryDatasource($SQL1); return $QueryResult;} } --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php