Madmoggie Posted December 9, 2009 Share Posted December 9, 2009 Hey <?php $productid = $_GET['productid']; $type = $_GET['type']; $name = $_GET['name']; $description = $_GET['description']; $price = $_GET['price']; $quantity = $_GET['quantity']; $query = "SELECT * FROM product"; $result = $db->query($sql); $result = mysql_query ($query) or die ("Error in query: $query. ".mysql_error()); $output[] = '<tr>'; print "<table border = 4 >"; print " <tr><th>Type</th><th>Name</th><th>Description</th><th>Quantity</th><th>Price</th></tr>"; while ($row = mysql_fetch_array($result)) { print "<tr>"; print "<td>" . $row["type"] . "</td>"; print "<td>" . $row["name"] . "</td>"; print "<td>" . $row["description"] . "</td>"; print "<td>" . $row["quantity"] . "</td>"; print "<td>£" . $row["price"]. "</td>"; print "<td>" . $row["!!!!!!!!!!"] "</td>"; print "</tr>"; } print "</table>"; echo join('',$output); ?> Where the !!!!!!! are i need this link - <a href="cart.php?action=add&id='.$row['id'].'">Add to cart</a> But when i put it in all the "" get mixed up - someone please help Manythanks Link to comment https://forums.phpfreaks.com/topic/184484-php-table-need-link-in-a-row/ Share on other sites More sharing options...
forumforme123 Posted December 9, 2009 Share Posted December 9, 2009 try this: print "<td> <a href='cart.php?action=add&id=" .$row['id']. "'>Add to cart</a></td>"; Link to comment https://forums.phpfreaks.com/topic/184484-php-table-need-link-in-a-row/#findComment-973930 Share on other sites More sharing options...
Madmoggie Posted December 9, 2009 Author Share Posted December 9, 2009 Thank you sooo much! i spent hours trying to work it out! lol Link to comment https://forums.phpfreaks.com/topic/184484-php-table-need-link-in-a-row/#findComment-974065 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.