Jump to content

iterate


rashmi_k28

Recommended Posts

Here is the value from the table which has the field name, timestamp and status.

 

I have to find the differnence between the 1 and 2nd, 2nd and 3rd rows.... and check the differnence is less than 11 min. When the difference is no less than 11 min I have to calcualte the timestamp.

Suppose the timestamp 2008-05-18 11:30:01 between 2008-05-18 12:10:01 has less than 10 min each. So calculate the difference between strtotime('2008-05-18 12:10:01') and strtotime('2008-05-18 11:30:01').

 

 

| A       | 2008-05-18 11:30:01 |      0 |
| A        | 2008-05-18 11:40:01 |      0 |
| A        | 2008-05-18 11:50:01 |      0 |
| A        | 2008-05-18 12:00:01 |      0 |
| A        | 2008-05-18 12:10:01 |      0 |
| A        | 2008-05-18 12:20:01 |      0 |
| A        | 2008-05-18 17:20:01 |      0 |
| A        | 2008-05-18 17:30:01 |      0 |
| A        | 2008-05-18 17:40:02 |      0 |


Link to comment
https://forums.phpfreaks.com/topic/106267-iterate/
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.