Thanks again for the help with my earlier inquiry. I am now able to see the result of my query as show below:
Name: Chinua Achebe
Title: Things Fall Apart
Genre: Fiction
Information:
Date Added: 0000-00-00
My problem now is how to present the results of my query in a tabular form, as shown below:
Name Title Genre Inform Date
Achebe Things 'Apart Fiction 0000-00-00
Could you please help me with the lines of code that will make that possible? Here is what I have tried, but no data was displayed.
<?php
include("connection.inc");
?>
<html>
<head>
<title>Detail Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="styles.css">
</head>
<body>
<?php
$rs = @mysql_select_db("lhsnycne_mydatabase",$conn) or die("error connecting to the database");
#using the wildcard (%) character in the last half of the statement allows users to search with only the first few letters of the name
#another wildcard is placed between the first ' and " to allow total matching searching
$sql = "SELECT * FROM novels2 WHERE id = " .$id = $_GET['id'];
$rs = mysql_query($sql, $conn);
$list = "<table border=\1"\ cellpadding=\"2\">";
$list.="<tr><th>Name</th>;
$list.="<th>Title</th>;
$list.="<th>Genre</th>;
$list.="<th>Information</th>;
$list.="<th>Date</th>;
while ($row= mysql_fetch_array ($rs) )
{
$list .= "<tr>";
$list .= "<td>".$row["lname"] ."</td>";
$list .= "<td>".$row["title"] ."</td>";
$list .= "<td>".$row["genre"] ."</td>";
$list .= "<td>".$row["info"] ."</td>";
$list .= "<td>".$row["dte"] ."</td>";
$list .= "</tr>";
}
$list .= "<table>";
echo($list);
?>
<h3>Here are the details....</h3>
<?php
$row = mysql_fetch_array($rs);
echo("<p>Name: " . $row["fname"] . " " . $row["lname"] . "<br>");
echo("Title: " . $row["title"] . "<br>");
echo("Genre: " . $row["genre"] . "<br>");
echo("Information: " . $row["info"] . "<br>");
?>
<a href=<?php echo ($row["url_1"]);?> target="_blank"><?php echo ($row["url_1_description"] . "<br>"); ?></a>
<?php
#echo("Year Published: " .$row["year"] . "<br>");
echo("Date Added: " .$row["dte"] . "</p>");
?>
<br>
<a href="http://lhsnyc.net/library/novels2/search01.php">Home</a>
</body>
</html>