All pastes #226448 Raw Edit

Stuff

public text v1 · immutable
#226448 ·published 2006-10-28 14:40 UTC
rendered paste body
<?php
//This page displays the available products.

//Set the page title and include the HTML header.
$page_title = 'Browse Products';
include_once ('includes/header.php');

require_once ('mysql_connect.php'); //Connect to the database.

echo '<table border="0" width="90%" cellspacing="3" cellpadding="3" align="center">
<tr>
<td align="left" width="20%"><b>Product Name</b></td>
<td align="left" width="40%"><b>Description</b></td>
<td align="right" width="20%"><b>Price</b></td>
</tr>';

//Display all the URLs.
$result = mysql_query ($query);
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)){

//Display each record.
echo "<tr>
<td align=\"left\"><a
href=\"view_product.php?aid={$row['pid']}\">{$row['name']}</td>
<td align=\"left\">" . stripslashes($row['description']) . "</td>
<td align=\"right\">\${$row['price']}</td>
<tr>\n";

} //End of while loop.

echo '</table>'; //Close the table.

mysql_close(); //Close the database connection.
include_once ('includes/footer.php'); //Require the PHP footer.
?>