MySql function

2006-04-26 Thread Akpome Akpoguma
Hi Everyone,
   
  i did the following
   
  $dbh-prepare(UPDATE contentTable SET filename = '$dbfile date_modefied = 
'CURRENT_DATE()' time_modefied = 'CURRENT_TIME() WHERE ext = '$ext' )
   
  and the value of the current date and current time were not updated on the 
table. It seems perl interpolated the function CURRENT_DATE() and 
CURRENT_TIME() .everything else is ok
   
  can someone help with a way out.
   
   
  Rgds

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

RE: MySql function

2006-04-26 Thread Ronald J Kimball

Akpome Akpoguma [mailto:[EMAIL PROTECTED] wrote:
 
 Hi Everyone,
 
   i did the following
 
   $dbh-prepare(UPDATE contentTable SET filename = '$dbfile date_modefied
 = 'CURRENT_DATE()' time_modefied = 'CURRENT_TIME() WHERE ext = '$ext' )
 
   and the value of the current date and current time were not updated on
 the table. It seems perl interpolated the function CURRENT_DATE() and
 CURRENT_TIME() .everything else is ok

Why did you put single quotes around the MySql function calls?  That tells
MySql that these are strings, not function calls.

Also, you should be using placeholders for the variables.  Try this:

$dbh-prepare('UPDATE contentTable SET filename = ?, date_modified =
CURRENT_DATE(), time_modified = CURRENT_TIME() WHERE ext = ?');

$dbh-execute($dbfile, $ext);


Ronald