Hi Guys
I have a form that uploads multiple images at once. I have a Select query that displays this images based on the date added. The format is this YYYY-MM-DD HH:MM:SS . The only problem is that sometimes the images get uploaded at the same second. As you would have guessed it this breaks. I also found out that MySQL doesn't store microseconds so I need a way to do this. I thought about Timestamps don't know how to generate it correctly in the PHP code before INSERT. any suggestions?
I'm trying to get it inserted into the db but I kept getting odd results.
Like the number 1230581547.2404211 gets inserted into the db as 1.23058e+009 with the float data type. Do you know what the problem is?
What data type did I need to use for this to work and micro time work for this.
Here is my good to generate the microtime
PHP Code:function mtime()
{
preg_match('/^0\.(\d+) (\d+)$/',microtime(),$out);
return $out[2].'.'.$out[1];
}
$uniqueTime = mtime();
$uniqueTime = number_format($uniqueTime,7,'.', '');







Bookmarks