FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » problem saving date fields
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: problem saving date fields [message #174160 is a reply to message #174155] Mon, 23 May 2011 18:16 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 5/23/2011 1:27 PM, Co wrote:
> On 23 mei, 13:13, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>> On 5/23/2011 12:51 AM, Co wrote:
>>
>>>> ==================
>>
>>> Wow you guys really love each other.
>>
>>> Marco
>>
>> Yea, unfortunately, you have to put up with some trolls on usenet.
>>
>
> So when one of the three dates is not changed it returns the month
> written.
> Than this code:
> $arrival_month = preg_replace('#[^0-9]#i', '',
> $_POST['arrival_month']);
> ruins the date and it gets set back to 00-00-0000.
> Is there a way to detect changes? because than I could set an if
> statement before
> running the UPDATE query and we leave out the dates that were not
> changed.
>
> Marco

OK, the question is, where is it getting the month name instead of the
number? It has to be coming from your html code. Look at the page
source and see where you're putting 'April' in there instead of 4.

As for detecting when the data changed - the only way is to do something
like save the current data in your $_SESSION and compare when it is
retrieved. However, that isn't necessary if you get your problem with
the month name being retrieved. It doesn't hurt to update a value in
the database with the same value.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: is dis da place?
Next Topic: foreach in reverse
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 20:48:49 GMT 2024

Total time taken to generate the page: 0.04149 seconds