[RESOLVED] MySQL 5 NOW() function.. unexpected..

$link = new mysqli(MYSQL_NAME, MYSQL_USER, MYSQL_PASS, MYSQL_DBNAME);
if ( mysqli_connect_errno() )
{
echo 'Too many users connected to the database!<br />Please try again later.';
}
else
{

$query = "UPDATE time_actions SET proc_start=NOW() WHERE pid=555";
$result = $link->query($query);

echo 'Going to sleep now<br />';

sleep(10);

echo 'WAKED UP!<br />';

$query = "UPDATE time_actions SET proc_end=NOW() WHERE pid=555";
$result = $link->query($query);

$link->close();
echo '<br />FINISHED!<br />';
}


Problem is because proc_start and proc_end fields end up with a SAME value(timestamp) in DB, even I did set pause for 10 seconds.

If I use PHP's time() function instead NOW() then all is well, but I wana use NOW()...

Help Please, why does it behave that way?
[1012 byte] By [Ipsens] at [2007-11-20 9:28:18]
# 1 Re: [RESOLVED] MySQL 5 NOW() function.. unexpected..
What are the properties (type, default value etc.) of the columns proc_start and proc_end?
andreasblixt at 2007-11-9 13:45:27 >
# 2 Re: [RESOLVED] MySQL 5 NOW() function.. unexpected..
I've just figured out (15 min) ago that proc_start had a "on_update current timestamp".

And no, I didn't set it, so it must be a default value..

Ok, it is solved now...

Thanks!
Ipsens at 2007-11-9 13:46:27 >
# 3 Re: [RESOLVED] MySQL 5 NOW() function.. unexpected..
Yes, I figured. The TIMESTAMP data type does that by default. Generally when storing manual timestamps, I use INT and save UNIX_TIMESTAMP() into it. I only use TIMESTAMP when I want the column to automatically update itself.
andreasblixt at 2007-11-9 13:47:27 >
# 4 Re: [RESOLVED] MySQL 5 NOW() function.. unexpected..
Normally, I do it exactly a same way, because it is much easier to manipulate with time in unix timestamp format with PHP, but now I had a special needs
Ipsens at 2007-11-9 13:48:32 >