Jump to content

Need help with selling script!?


Kryllster

Recommended Posts

I am trying to make an rpg another one I might add. I have a basic script that adds the right loot items and prices and descriptions. It has a post form to submit but when I do it only sells the first itme in the list and not the one that is checked with a radio button any help?

<img src="images/inventory.jpg" alt="" />

<table width="100%" cellpadding="1" cellspacing="0" border="2">
<tr colspan="7">
<td>Slot</td><td>Item</td><td>Level<td>Power</td><td>Sell Price</td><td>Sell Item</td><td>Wear Item</td>
<?php
	// include char files and loot files
	include "php/db/db_config.php";
	
	// create variables from db and loot
	$username = $_SESSION['username'];
	$player_id = $account_info['player_id'];
	
	// select from loot db
	$result = mysqli_query($my_database,"SELECT * FROM inventory WHERE username = '$username'") or die (mysqli_error($my_database));
    		//$counter = 0;
            while ($row = mysqli_fetch_assoc($result)) {
	            echo '<tr>';
	            echo '<td>';
	            //$counter++;
	            //echo $counter;
	            echo '</td>';
	            echo '<td>';
           		echo $row['item'];
           		echo '</td>';
           		echo '<td>';
           		echo $row['level'];
           		echo '</td>';
           		echo '<td>';
           		echo $row['power'];
           		echo '</td>';
           		echo '<td>';
           		echo $row['sell_price'];
           		$row['sell_price'];
           		echo '</td>';
           		echo '<td>';
           		echo '<form action="index2.php?content=sell_item" method="post">';
           		echo '<input type="radio" name="id">';
           		echo '<input type="submit" value="Sell This Item">';
           		echo '</form>';
           		echo '</td>';
           		echo '<td>';
           		echo '<form action="loot/wear_item.php" method="post">';
           		echo '<input type="hidden" name="two">';
           		echo '<input type="submit" value="Wear This Item">';
           		echo '</form>';
           		echo '</td>';
           		echo '</tr>';
            }
?>
</table>
Link to comment
https://forums.phpfreaks.com/topic/297375-need-help-with-selling-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.