Current location: Hot Scripts Forums » Programming Languages » PHP » Reducing stock automatically when sale product!!!!


Reducing stock automatically when sale product!!!!

Reply
  #1 (permalink)  
Old 06-14-05, 08:21 AM
shiqla shiqla is offline
Newbie Coder
 
Join Date: Jun 2005
Location: mALaySia
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Reducing stock automatically when sale product!!!!

I ve problem with this codes.Im working with php & mySQL to build system inventory.So, i want it to be like this.When we sale product,it will reduce the amount that we store in stock record automatically.So, the record in stock record will always be updated automatically.So, we will know the quantity of stock in stock record.Pls help me dude!!!!May be you have another example or can help me to modify this codes.It cannot run,and gives error.


PHP Code:

<? 

include 'dbase.php';

$namaproduk=$_POST['namaproduk'];
$hargaseunit=$_POST['hargaseunit'];
$peratuskeuntungan=$_POST['peratuskeuntungan'];
$hargajualan=$_POST['hargajualan'];
$profit=$_POST['profit'];
$biljualan=$_POST['biljualan'];
$tarikh=$_POST['tarikh'];
$query "INSERT INTO jualan VALUES('$namaproduk','$hargaseunit','$peratuskeuntungan','$hargajualan','$profit','$biljualan',NOW(),'')";
$result=mysql_db_query($dbname,$query);
$ques "select bilJualan from jualan";
$rest mysql_query($ques);
$bilJ $row['bilJualan'];

$sqls "select bilStok from stok";
$que mysql_query($sqls);
$row mysql_fetch_array($que);
$bilS $row['bilStok'];

$total $bilS $_POST['biljualan'];

echo 
$total;

if(
$result){

$sql "UPDATE stok set bilStok='$total'"

header("Location:rekodjualan.php");

}
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHPAudit - billing and licensing for developers - Pre-v2 sale! Stop piracy now! tickedon General Advertisements 2 03-24-05 01:21 PM
HiveMail Sale! 30% Off! 3 Days Only! tubedogg General Advertisements 2 08-14-04 08:37 PM


All times are GMT -5. The time now is 01:33 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.