Jump to content

PHP table need link in a row


Madmoggie

Recommended Posts

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

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.