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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.