NYCPHP Meetup

NYPHP.org

[nycphp-talk] Need mini-code review

Donald J. Organ IV dorgan at optonline.net
Tue Sep 30 00:58:45 EDT 2003


try this:

$sql = "DELETE FROM nnet_produkt_bestilling WHERE nnet_produkt_placement > nnet_produkt_placement + '' . date("Y-m-d H:i:s", time() + $maxCartTime);
  ----- Original Message ----- 
  From: Phil Powell 
  To: NYPHP Talk 
  Sent: Tuesday, September 30, 2003 12:31 AM
  Subject: [nycphp-talk] Need mini-code review


  $sql = 'DELETE FROM nnet_produkt_bestilling ' .
            'WHERE nnet_produkt_placement > ' .
            'nnet_produkt_placement + \'' . date("Y-m-d H:i:s", time() + $maxCartTime) . '\'';

  This is supposed to delete all rows in nnet_produkt_bestilling whose value in the field nnet_produkt_placement is more than $maxCartTime seconds old ($maxCartTime, in this case = 86400 seconds, or 24 hours).  I am unsure if this is the correct syntax using mySQL to do such an action upon a DATETIME field column datatype, so if someone could look that over and see how far out of the ballpark I really am I'd appreciate it.

  Thanx
  Phil


------------------------------------------------------------------------------


  _______________________________________________
  talk mailing list
  talk at lists.nyphp.org
  http://lists.nyphp.org/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030930/93fc6cfc/attachment.html>


More information about the talk mailing list