Jump to content

What Does This Sql Statement Do?


yoursurrogategod

Recommended Posts

I have this piece of PHP code:

function OffsetDate($dayFraction, $date = false) {
if(!$date) {
$date = 'CURDATE()';
}

$fraction = $dayFraction * 24 * 3600;

return $date . ' + INTERVAL ' . $fraction . ' SECOND';
}

 

If I were to put in -28 as an input value (and only that value), this is the result that I would get:

"CURDATE() + INTERVAL 2419200 SECOND "

 

What will that SQL code do? What does it mean? I have to maintain this PHP code, but I don't quite understand how this SQL would work in a simulated environment.

Link to comment
https://forums.phpfreaks.com/topic/270367-what-does-this-sql-statement-do/
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.