poisedforflight
11-13-2005, 07:54 AM
I am trying to pull some information out of two tables and format it in an html table. This is my code, it tells me the query fails.
<?
include 'db.php';
$topicId=$_REQUEST['topicId'];
dbConnect("jmcclure_MyNotes");
$query = "topicName, topicBody FROM topicsTable, entryTable WHERE topicParent = $topicId";
$result = mysql_query($query) or die ("Query 'A' Failed");
?>
<html>
<head>
<title>MyNotes</title>
</head>
<body>
<table>
<?
while($row = mysql_fetch_assoc($result)){
print "<tr>";
print "<td>";
print $row['topicName'];
print "</td></tr>";
print "<tr>";
print "<td>";
print $row['topicBody'];
print "</td></tr>";
}
print "</table>";
?>
</body>
</html>
--------------------------------------------------------------------
Any ideas?
<?
include 'db.php';
$topicId=$_REQUEST['topicId'];
dbConnect("jmcclure_MyNotes");
$query = "topicName, topicBody FROM topicsTable, entryTable WHERE topicParent = $topicId";
$result = mysql_query($query) or die ("Query 'A' Failed");
?>
<html>
<head>
<title>MyNotes</title>
</head>
<body>
<table>
<?
while($row = mysql_fetch_assoc($result)){
print "<tr>";
print "<td>";
print $row['topicName'];
print "</td></tr>";
print "<tr>";
print "<td>";
print $row['topicBody'];
print "</td></tr>";
}
print "</table>";
?>
</body>
</html>
--------------------------------------------------------------------
Any ideas?