Can not set a NOW() in datetime field mysql with php
<p>Hello I'm having a hard time trying to update this field automatically when I update something else in that same table called 'reps' the structure of the table is:
id int primary key,
name varchar(10) not null,
date_up datetime</p>

<p><strong>When I run this query:</strong> </p>

<pre><code>SELECT * FROM reps; 
</code></pre>

<p>it shows the information correctly however when I try to update a row of this table the date_up field is not updating... here's my code:</p>

<pre><code>require dirname(__FILE__).'/db/connect.php';
$id = 5;
$name = "LCD Replacement";

$conexion-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$statement = $conexion-&gt;prepare('UPDATE reps SET name=:name, date_up = NOW() WHERE id = :id');
$statement-&gt;execute(array(
    ':name' =&gt; $name,
    ':id' =&gt; $id
));
</code></pre>

<p>when I refresh the page nothing is updated but if I run that same SQL query on the mysql console it work so I don't know what I'm doing wrong??</p>