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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.