Breaking results into week blocks
Posted on
16th Feb 2014 07:03 pm by
admin
I have a set of dates (and times), which are returned from a mySQL query.
These usually span from 1-2 months and I need to be able to separate the results (using HTML) every sunday (monday being the start of the week).
Did you know?Explore Trending and Topic pages for more stories like this.
Set of timestamps....
Code: [Select]1255482000
1255483800
1255485600
1255487400
1256086800
1256088600
1256090400
1256092200
1256691600
1256693400
1256695200
1256697000
1257300000
1257301800
1257303600
1257305400
1257904800
1257906600
1257908400
1257910200
1258509600
1258511400
1258513200
1258515000
1259114400
1259116200
1259118000
1259119800
Currently the code looks like this, but having trouble getting round the logic of doing this...
Code: [Select]<?php
while ($sqlresults = mysql_fetch_array($results)) {
$compare = strtotime(date('d F Y',$laststamp)." next Sunday");
echo $sqlresults['timestamp'].'
';
if ($sqlresults['timestamp'] != $laststamp) {
if ($compare > $laststamp) {
#HTML CODE
}
}
$laststamp = $sqlresults['timestamp'];
}
?>
But at the moment it just puts HTML code inbetween every time
No comments posted yet
Your Answer:
Login to answer
101
42
Other forums
Logging and nologging bulk insert
Hi,
oracle version: 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
'210010106140040100' == '210010106140040101'
Debugging this simple line of a PHP script
Code: if($a == $b){ }
I've found that with val
DATEDIFF Question
First time post, and of course it is a help question.
I am using a WP plug-in to display prev
Unable to customise toolbar in FCK
Does deleting the spmlog directory critical?
Hi Everyone,
Please, hope you could help me. We're having problems with the SAP backup. I
help with multi-update
Now sure how to ask this really....
10g database if that matters.
I have a customer
1,000 select boxes with 100 options?!
I have 1 drop down select box with 1,000 options.
In some case, there will be 100+ of the
Php script to read msword file
hi,
I need to read a msword file and i want to print the contents in that word file.
i
The type or namespace name 'ServiceModel' does not exist in the namespace 'System'
When I locally run the website, it works just fine, but when I uploaded it to the hosting environmen
Need help to identify this error please
:confused:Can anyone help me tell what this error message means? Maybe tell me where to look to fix