0

hello i want to creat script "most viewed" so i want to select most topic that have been wached between two dates for instance

from date 10,10,2012 to current date

i mean from 10 days ago untill current time

Edited by cssweb

2
Contributors
6
Replies
27
Views
4 Years
Discussion Span
Last Post by cssweb
0

i have tried it but no date selected it is blank page,my date that i have stored it in database as this:18,10,2012"$today =gmdate("d,m,Y");"

<html>
<head><meta charset='utf-8'/></head>
<body>

<?php 

include "config.php";



$select=mysql_query("select * from topics where 
date BETWEEN DATE_SUB(NOW(),INTERVAL 10 Day) AND NOW()")or die(mysql_error());



while ($row=mysql_fetch_object($select)){
echo $row->topic_title;
echo "<br/>";
}


?>
</body>
</html>

Edited by cssweb

0

i do not understand what do you mean exactly but i want to remember you i have used this string to store date
$today =gmdate("d,m,Y");
does DATE_SUB accept date as i used in $today string

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.