I have tried to use this code but I can get it to work well in my server. When I run the mysql query in mysql it gives me the result that I want but within the code it does not output anything. It just gives a blank page. What can be wrong please.
<?php
if(isset($_GET['page2']))
{
include 'dbconnect.inc';
$year = $_GET['page2'];
$query = "select distinct MONTH(publicationdate) from agricultural_research_journal where year(publicationdate) = '$year' order by id asc";
$result = mysql_query($query) or die('Error, query failed');
$num_result = mysql_num_rows($result);
//to pick the dates
for ($i=0; $i <$num_result; $i++)
{
$story = mysql_fetch_assoc($result);
print '<table width = "385" border="1" align = "center">';
print '<tr>';
print '<td>';echo '$num_result';
$my_date = mysql_result($result, $i);
echo "<a href=month.php?month=$my_date>$my_date</a>";
print '</td>';
print '</tr>';
print '</table>';
}
}
?>