im working on a project repoting.database have almost up to 50000 records in a table. in this project i need to sort out records by days or month or by year. but problem is every recods have a column “addtime” there time() has been stored when record enterd.
i checked and with date(“d/m/Y”,$records[‘addtime’]) working fine. but how i can show by day or year and month below is my code please help its very importent and urgent.
[php]$result = $sm->queryfnc(“select * from {tbl}authors where status=1 and YEAR(addtime)=2011”, ‘Get Result’);
$rows = $sm->rowsfnc($result, ‘Get Rows’);
if($rows>0){
while($records = $sm->recordsfnc($result, ‘Get Records’)){
echo date(“d/m/Y”, $records[‘addtime’]).’
';
}
}[/php]
Thanks in advance for your attention