Jump to content

"time"-related issue. Error in the code?


xwishmasterx

Recommended Posts

Hello I am trying to only display results within the time period last sunday too next sunday. my code:

<?php
$today = date('Y-m-d H:i:s');
$time = strtotime($today);
$last_sunday = strtotime('last sunday', $time);
$next_sunday = strtotime('next sunday', $time);
$format = 'Y-m-d H:i:s';
$last_sunday = date($format, $last_sunday);
$next_sunday = date($format, $next_sunday);
?>
<?php
$sql_totalsurfs = ("SELECT vtp_members.id, vtp_members.name, vtp_members.teamleader, vtp_tracking.Timber, vtp_tracking.Stone, vtp_tracking.Marble, teams.team_name, count(vtp_tracking.id) surfs
FROM vtp_members, vtp_tracking, teams
WHERE vtp_members.team_id=".$_GET['t']." AND vtp_tracking.credit_members_id=vtp_members.id AND vtp_tracking.action_date>'$last_sunday' AND vtp_tracking.action_date<'$next_sunday'
GROUP BY vtp_members.id
ORDER BY surfs DESC LIMIT 0, 10");
$rstotalsurfs = mysql_query($sql_totalsurfs);
$numrows = mysql_num_rows($rstotalsurfs);
.......

 

Is there and error somwhere in the code?

Link to comment
https://forums.phpfreaks.com/topic/234098-time-related-issue-error-in-the-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.