<?php
// This page displays the details for a particular print.
if (isset($GET['pid']) && is_numeric ($GET['pid'])) {
// Make sure there's a print ID.
require_once ('./mysql_connect.php'); // Connect to the database.
$query = "SELECT * FROM category, product WHERE category.category_id = product.category_id AND product.pid = {$_GET['pid']}";
$result = mysql_query ($query);
$row = mysql_fetch_array ($result, MYSQL_ASSOC);
mysql_close(); // Close the database connection.
// Set the page title and include the HTML header.
$page_title = $row['product_name'];
// Display a header.
echo "<div align=\"center\">
<b>{$row['product_name']}</b> by
{$row['first_category']} {$row['middle_category']} {$row['last_category']}
<br />{$row['size']}
<br />${$row['price']}
<a href=\"add_cart.php?pid={$row['pid']}\">Add to Cart</a>
</div><br />";
// Here is the coding part coding I have a problem. What sysntax I need to use the if statement so that it appear this one.....display the description
echo '<br />' . stripslashes($row['description']) . '</div>';
// else
echo '<p>No description available.
} else { // Redirect
header ("Location: [url]http://[/url]" . $SERVER['HTTP_HOST'] . dirname($SERVER['PHP_SELF']) . "/index.php");
exit();
}
?>// Here is the coding part coding I have a problem. What sysntax I need to use the if statement so that it appear this one.....display the description