Jump to content

iDontKnowOfAGoodUsername

New Members
  • Posts

    3
  • Joined

  • Last visited

iDontKnowOfAGoodUsername's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I have a table that I read in from a postgresql database but I need to add a column that has checkboxes in the final row. It is for a shop so then when the item is selected via checkbox I can then press an add to cart button and send this using an array to the cart.php page. Firstly I need to be able to add checkboxes to the end of each row before I can even do that and I am struggling at how to get a checkbox at the end of each row of my table. <form action="index.php" method="post"> <table> <tr> <th>ref</th> <th>title</th> <th>platform</th> <th>description</th> <th>price</th> <th>select</th> </tr> <?php $resource = pg_query ($connect, "select refnumber,title,platform,description,price from CSGames"); while ($row = pg_fetch_array ($resource)) { $result[] = $row; } foreach($result as $key => $value) { echo "<tr>"; for ($j = 0; $j < pg_num_fields ($resource); $j++) { echo "<td>".$a[$j]."</td>"; } echo "</tr>"; } ?> </table> Could any help with this and explain so I can understand what is occurring in the future please?
  2. Hello, I currently have a table that displays a list of elements from a shop. The information comes from a postgreSQL database and is then shown on index.php using a table. The problem I have is I need to add a checkbox to the end of each row so when I select multiple items I can add them to basket. I have the 'select' column set up but no checkboxes as of yet. I need to first implement the checkboxes and then from there I can get and post the selected items into the basket.php page. Any help would be massively appreciated. This is probably something simple im just overseeing. Would rather you also explain than try and give a straight up answer as I am more likely to learn that way. Thank you
×
×
  • 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.