From: peter Date: 2007-03-01T02:55:55+09:00 Subject: Re: ruby datetime to mysql Hi Again The one script is eruby index.rhtml the other is not ruby and it does not use a date or time it simply resets the users quota which also unfortunately updates the time stamp. I need to make a string that {#date} is the format that mysql uses, This is from memory. I connect via dbi to a remote db server on the lan. dbh.do("UPDATE member SET counter = counter + 1, ip = '#{ENV['REMOTE_ADDR']}', datetime ='{#date}' WHERE username = '#{ENV['REMOTE_USER']}'") end Peter On Thu, 2007-01-03 at 02:00 +0900, Tim Becker wrote: > > I can use the mysql built in timestamp however I have > > another script that runs daily at midnight which of course updates the > > timestamp on all records. So I need to add a datetime string to my > > update with a date that mysql understands. > > Assuming their both ruby scripts, I'm not sure I understand why one > would understand ruby time objects, but not the other. > > I think to diagnose this further, we really just need to look at how > you're implementing this, what error messages you're getting, how > you're accessing mysql... > > Cheers, > -tim > >