Hey, I am trying to make a script where you can setup a sale like item name ,description amount and so on and it works from phpbb cash mod. So lets say you setup a sale and then it gets added to the database and on a certain page that shows the newest things up for sale. This is the temporary file that shows the newest items up for sale:
it works perfect and shows all the required stuff. This is where the problem occors that i cant figure out. In the database each new sale setup gets a sale_id e.g 1,2 and so on. In the page that shows the newest sales i want to be able to add a link to each item name like http://www.mydomain.com/sales/index.php?id=1 and the user can click on it to get to another page where i can use the $_GET[] to get the user id and retrieve the info for that sale _id.
If you have any idea could you please share them? i really need to get this figured out. Thanks in advance.
| Code: |
|
<table border="1"> <tr> <th>Name</th><th>Description</th><th>Other</th><th>Amount</th> </tr> <?php include('../db.php'); $sql = "SELECT item_name, item_description, item_other, amount FROM sale"; $resource = mysql_query($sql) or die('Error in query: ' . mysql_error()); while ($row = mysql_fetch_row($resource)) { echo '<tr>'; foreach ($row as $value) { echo "<td>$value</td>"; } echo '</tr>'; } ?> </table> |
it works perfect and shows all the required stuff. This is where the problem occors that i cant figure out. In the database each new sale setup gets a sale_id e.g 1,2 and so on. In the page that shows the newest sales i want to be able to add a link to each item name like http://www.mydomain.com/sales/index.php?id=1 and the user can click on it to get to another page where i can use the $_GET[] to get the user id and retrieve the info for that sale _id.
If you have any idea could you please share them? i really need to get this figured out. Thanks in advance.
