recently,im developing an inventory system. the problem is i still dont know how to automatically update the quantity in the stock after the user take the items and how to add the item to the cart as in a shopping cart system. pls help..im using easyphp and i do not use class and function in my system.help me pls...

this is the sample of my code:
<table width="80%" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC">
<tr>
<td width="18%" bgcolor="#E0E2EB"><div align="left">Description : </div></td>
<td width="82%"><? echo $row['description']; ?></td>
</tr>
<tr>
<td bgcolor="#E0E2EB"><div align="left">Item Code : </div></td>
<td><? echo $row['item_code']; ?></td>
</tr>
<tr>
<td bgcolor="#E0E2EB"><div align="left">Category : </div></td>
<td><? echo $row['category']; ?></td>
</tr>
<tr>
<td bgcolor="#E0E2EB"><div align="left">Current quantity : </div></td>
<td><? echo $row['quantity']; ?></td>
</tr>
<tr>

<td bgcolor="#E0E2EB">Required quantity : </td>
<td><input type="text" name="quantity" value="<? echo $row['quantity']; ?>">
<input type="hidden" name="id" value="<? echo $row['quantity']; ?>"></td>

</tr>

</table>

thnx in advance..

p/s: i stored the cart in the database.

    So, are you looking to update the shopping cart database based on dynamic changes to the cart? If so, AJAX is really the only way to in-page alter a database. If you don't know much about this, you can always store the objects in cookies and then update the database at certain keypages.

      thanks everyone..i will try tht on ..🙂

        <td><form name="form1" method="post" action="View_Item.php?ref=<? echo $ref ?>&action=getitem">
        <table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
        <td width="82%"><div align="center">
        <p> <? $item_code = isset($GET['item_code'])?$GET['item_code']:"";
        $quantity = isset($GET['quantity])?$GET['quantity']:"";

        $result = mysql_query("SELECT * FROM stationary
        WHERE item_code='$item_code'") or die(mysql_error());

        $row = mysql_fetch_array( $result );
        $quantity = 'count';
        $count = $row['count'] - 1;

        $result = mysql_query("UPDATE stationary SET count='$count' WHERE item_code='$item_code'")
        or die(mysql_error());

                                              <input name="Search" type="submit" id="Search" value="Submit">
                                                </p>

        cant work..anyone hv any greater idea to modify the code?
        i just want the user to be able to get the item, then display it in their cart in case they want to add other item or cancel it and then submit it to be taken. quantity in the stock then will automatically reduce itself.
        anyone...pls help...

          ... 10 minute3s between being shown a tutorial an dy indicating you can't get it to work? You gotta be joking!

          Anyway.. 'it doesn't work' is not very informative.. please tell us what doesn't work and the errors you are getting

            no no..dont misunderstand me..i get tht not from the tutorial..i still cant open the tutorial site right now..and still trying..my network suckz..huhu..doesnt work is that it doesnt display anything..just the submit button.

              well.. as you are only outputting a button that is not surprising. What were you hoping on getting?

                oohh..ok..sory, im very new at this..

                  Write a Reply...