Re: Date math functions...

From: Date: Wed, 15 Jan 2003 18:46:50 +0000
Subject: Re: Date math functions...
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-24884@lists.php.net to get a copy of this message
> > > mysql("$DBName","UPDATE Balances SET CompEarned=CompTaken+8 WHERE > > > said='$said'") or die(mysql_error()); > > > mysql("$DBName","INSERT INTO Log VALUES(DATE_ADD($StopDate, > > > INTERVAL 1 DAY,'',1,2,'$CalendarDetailsID')") or > > > die(mysql_error()); > Actually this is generating another error. Now, without the single > quotes I am getting the following error: > > Column 'StartDate' cannot be null > > It looks like for some reason the DATE_ADD is returning a NULL > value. Any more ideas? Are you sure $StopDate has a value and is in the right format? Echo out your query to the screen when you get an error, so you can look for obvious mistakes. Is this just example code? You're using a function called mysql(), which isn't standard. ---John Holmes...

« previous php.db (#24884) next »