3 messages in com.mysql.lists.win32Re: help adding days
FromSent OnAttachments
Ryan Schefke14 Jun 2004 12:06 
Ryan Schefke14 Jun 2004 12:13 
SGr...@unimin.com14 Jun 2004 12:16 
Subject:Re: help adding days
From:SGr...@unimin.com (SGr@unimin.com)
Date:06/14/2004 12:16:40 PM
List:com.mysql.lists.win32

it looks like you forgot your close parentheses ")". Change: endDate=DATE_ADD(NOW(),INTERVAL $numdays DAY

To: endDate=DATE_ADD(NOW(),INTERVAL $numdays DAY)

I test all of my scripted statements by echoing them to the screen or by adding them as comments to my HTML so that I can run them directly in the mysql client. It would have helped you to find this error.

Respecfully, Shawn Green Database Administrator Unimin Corporation - Spruce Pine

"Ryan Schefke" <ryan@triomfgroup To: <win@lists.mysql.com> .com> cc: Fax to: 06/14/2004 03:06 Subject: help adding days PM

I'm using php and trying to add a certain number of days (string is $numdays) to a value in my mysql db. The startDate works but the endDate does not. Can you help me with the syntax and how I can do this? FYI, I'm on MYSQL 3.2.

$query_insertmonths = "UPDATE sitepayment SET timeperiod='$radiobutton', startDate=NOW(), endDate=DATE_ADD(NOW(),INTERVAL $numdays DAY WHERE customerID='$row[0]'";