RE: [PHP] Setting date fields in mysql queries
| From: | Matt Schroebel | Date: | Wed, 02 Oct 2002 19:19:39 +0000 |
| Subject: | RE: [PHP] Setting date fields in mysql queries | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-118638@lists.php.net to get a copy of this message | ||
> From: Brad Harriger [mailto:bradharriger@clarionhospital.org]
> Sent: Wednesday, October 02, 2002 3:17 PM
> Subject: [PHP] Setting date fields in mysql queries
>
>
> I have the following line in a program I'm working on:
>
> $query = "UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id"
>
> $ndate is a properly formated date read from a text field on
> a form on
> the previous page. When I run the query using mysql_query,
> it returns
> TRUE each time, but the field is not updated. The only explanation I
> can think of is that there is something wrong with the date
> value. I've
> echoed it to the screen and it looks fine, but the query
> still doesn't
> work. Any suggestions?
When you say it looks fine, are you meaning it looks like 2002-10-02?