Re: SQL/PHP problem

From: Date: Wed, 19 Dec 2001 17:20:12 +0000
Subject: Re: SQL/PHP problem
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15108@lists.php.net to get a copy of this message
What format is $expDate in? You'll need to make sure it's in the format your database expects for a date type column. Joshua Hoover > I'm trying to delete rows from a database where the date is older then my > $expDate variable, but for some reason, no matter what I try and what > examples I use for help, I can't get this to work??? I first took the > $expDate string and set the var type to "integer". The datatype for the > "msgCreated" field is "int". > > I first tried: > $sql = "DELETE * FROM Table WHERE msgCreated < '$expDate'"; > > and it didn't work so I then tried it without the single quotes: > > $sql = "DELETE * FROM Table WHERE msgCreated < $expDate"; > > still, it didn't work. Am I missing something fundamental here? Is this one > of those RTFM questions? > > Thanks, > > Brian

« previous php.db (#15108) next »