WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

Usage of now() function in PDO

Pintzy

New member

0

0%

Status

Offline

Posts

29

Likes

0

Rep

0

Bits

155

3

Months of Service

0%
Friends, I'm transitioning my site to PDO. I did some research online, but with my limited English skills, I couldn't quite understand the solutions. That's why I'm asking here. $query = $db->prepare("UPDATE members SET last_login_date = ? WHERE username = ?"); $update = $query->execute(array('NOW()',$username)); As you can see in the above code, when I enclose the NOW() function in quotes, the code runs but the datetime value comes as 0000-00-00 00:00:00. If I run it without quotes, I get an error which leads to a white screen as if there's a syntax error. My question is, how do I use this NOW() function within PDO?
 

249

6,622

6,642

Top