Re: updating date field

From: Date: Tue, 21 Nov 2006 05:38:40 +0000
Subject: Re: updating date field
References: 1 2 3 4  Groups: php.db 
Request: Send a blank email to php-db+get-42705@lists.php.net to get a copy of this message
John Pillion wrote:
[sorry, I failed to cc the list]
You have sql injection bugs waiting to happen here. make sure the eventid is an integer at least: ..." . (int)$_GET['eventid'] . "'"; And I also suggest reading up about escaping strings (http://php.net/mysql_real_escape_string & http://php.net/mysql_escape_string).
Thanks, I'll take care of that.
I was going to suggest it's an invalid date-format but that looks fine. What is eventdate? a date field, a timestamp, other ?
It's a date field. I'm doing the same thing with other tables, and don't have any trouble when inserting the date, it seems to only be when updating. I've even tried doing the query from the phpMyAdmin - and again, it seems to execute ok, and doesn't return any errors, but the date gets lost. I haven't tried updating *only* the date field from phpMyAdmin - I'll try that tomorrow
Another thing to check - does it have a default on that field? Maybe try removing that and see what happens? -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#42705) next »