Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-25-2013, 08:43 PM   PM User | #1
afi ali
New to the CF scene

 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
afi ali is an unknown quantity at this point
pass the value between two table

im develop a transaction function here. as you can see below, there are two tables. which is the first one is for display the item and the second table is for purchasing. what i want to do is, the row for item in first table is clickable. as the row is click, the item that have been choose come out in the second table. and at the second table cell for discount can be editable and the total price is changing by the discount. is anyone can help me how to pass the value between the two table?

Code:
<fieldset>
<legend>Item Show</legend>
<table border="1">
<tr>
  <td>Item Name</td>
    <td>Item Code</td>
    <td>Manufacturer</td>
    <td>Price</td>
    <td>Stock</td>
</tr>
<?php
while($row = mysql_fetch_array($result))
  {
?>
<tr>
  <td><?php echo $row['item_name']; ?></td>
    <td><?php echo $row['item_code']; ?></td>
    <td><?php echo $row['item_manufacturer']; ?></td>
    <td><?php echo $row['sell_price']; ?></td>
    <td><?php echo $row['stock']; ?></td>
</tr>
<?php
}
?>
</table>
</fieldset>

<fieldset>
<legend>Item Sale</legend>
<table border="1">
<tr>
  <td>Item name</td>
    <td>Item Code</td>
    <td>Stock</td>
    <td>Price</td>
    <td>Quantity</td>
    <td>Discount</td>
    <td>Total Price</td>
</tr>
</table>
</fieldset>
afi ali is offline   Reply With Quote
Old 01-25-2013, 09:18 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
By "table" are you referring to a storage level such as mysql, or are you referring to the visually rendered tables within the HTML?
If you mean the dbms, that's a simple matter of issuing an INSERT statement. The purchase would be related to the provided data.
If you mean visually, that's entirely a Javascript functionality.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:14 AM.


Advertisement
Log in to turn off these ads.