im working on something that will display the title and the author, but i have seperate table for the title and author, my code displays the title but not the author, what should i do? heres my code
<html>
<body>
<form method=post action="find.php">
<h2>Search For:</h2>
<p>
Academic Year : <input type=text name=search size=9 maxlength=9>
<p>
<input type=submit name=submit value=List>
<input type=reset name=clear value=cancel>
</form>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
include 'conn.php';
$search=$_POST['search'];
$sy=explode('-',$search);
$result = mysql_query ("SELECT * FROM `tbl_upload` WHERE (`year` >= $sy[0] AND `year` <= $sy[1])");
echo '<h2>Result</h2>';
if ($row = mysql_fetch_array($result))
{
do{
echo "<b>Title:</b>";
echo '<a href="">'.$row["title"].'</a>';
echo "<br>";
$result2 = mysql_query ("SELECT * FROM `tbl_author`");
if ($row2 = mysql_fetch_array($result2))
echo "<b>Author:</b>";
echo $row2["author"];
echo "<p>";
}
while($row = mysql_fetch_array($result));
}
else
{
echo 'Sorry, no records were found!';
}
}
?>