Basically the script works fine and will display the following...
Title Studio Release
A Item A Studio 2007-06-12
I am after getting the date to format like this - 12 June 2007.
I have tried putting in the Date Format bit but it wont work or i get errors
Code: Select all
<?php
include 'connect.php';
if(!isset($_GET['page'])){
$page = 1;
} else {
$page = $_GET['page'];
}
$max_results = 15;
$from = (($page * $max_results) - $max_results);
$sql = mysql_query("SELECT * FROM table2 WHERE `release` > CURRENT_DATE ORDER BY 'release' LIMIT $from, $max_results");
$bgcolor = "#E0E0E0";
echo("<table>");
echo"<tr class=titlebg><td><b>Title</b><td><b>Studio</b><td><b>Release Date</b></tr>";
while($row = mysql_fetch_array($sql)){
if ($bgcolor == "#E0E0E0"){
$bgcolor = "#FFFFFF";
}else{
$bgcolor = "#E0E0E0";
}
echo("<tr bgcolor=".$bgcolor."><td width=350 nowrap>");
echo($row["title"]);
echo("</td><td width=175 nowrap>");
echo($row["studio"]);
echo("</td><td align=\"center\">");
echo($row["release"]);
echo("</td></tr>");
}
echo("</table>");
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM table2 WHERE `release` > CURRENT_DATE ORDER BY 'release'"),0);
$total_pages = ceil($total_results / $max_results);
echo "<center>Select a Page<br />";
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\">Prev</a> -";
}
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "$i ";
} else {
echo " <a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a> ";
}
}
if($page < $total_pages){
$next = ($page + 1);
echo "- <a href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next</a>";
}
echo "</center>";
?>