Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #1811

Re: problem saving date fields

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: problem saving date fields
Date 2011-05-23 14:16 -0400
Organization A noiseless patient Spider
Message-ID <ire89l$9bn$1@dont-email.me> (permalink)
References (12 earlier) <12hjt69s0rkpkcodu7nqpdcdt8te0nk7e0@4ax.com> <ircgse$96m$1@dont-email.me> <e74cd181-0d6a-4c5b-af54-ae3ae9b6279c@gv8g2000vbb.googlegroups.com> <irdfg5$v84$1@dont-email.me> <14983f67-9bfd-4ac0-bfd9-ef82fb30a952@gv8g2000vbb.googlegroups.com>

Show all headers | View raw


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@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-20 11:38 -0700
  Re: problem saving date fields Luuk <Luuk@invalid.lan> - 2011-05-20 20:50 +0200
  Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-21 08:58 +1000
    Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-20 22:35 -0400
      Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-21 13:13 +1000
        Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-20 23:47 -0700
          Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-21 00:18 -0700
            Re: problem saving date fields Luuk <Luuk@invalid.lan> - 2011-05-21 09:54 +0200
            Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-21 10:37 -0400
              Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-21 08:07 -0700
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-21 19:55 -0400
                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-22 14:20 -0700
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 17:28 -0400
        Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-21 10:32 -0400
          Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-22 02:08 +1000
            Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-21 20:01 -0400
              Re: problem saving date fields "Twayne" <nobody@devnull.spamcop.net> - 2011-05-21 20:30 -0400
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-21 23:13 -0400
              Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-22 14:28 +1000
                Re: problem saving date fields Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-22 12:45 +0200
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 08:26 -0400
                Re: problem saving date fields "Twayne" <nobody@devnull.spamcop.net> - 2011-05-22 09:20 -0400
                Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-23 00:08 +1000
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 13:47 -0400
                Re: problem saving date fields Bill B <me@privacy.net> - 2011-05-22 14:17 -0400
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 14:26 -0400
                Re: problem saving date fields Bill B <me@privacy.net> - 2011-05-22 16:27 -0400
                Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-23 09:01 +1000
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 20:21 -0400
                Re: problem saving date fields Bill B <me@privacy.net> - 2011-05-22 21:36 -0400
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 21:46 -0400
                Re: problem saving date fields Jeff North <jnorthau@yahoo.com.au> - 2011-05-23 12:20 +1000
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-22 22:30 -0400
                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-22 21:51 -0700
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-23 07:13 -0400
                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-23 10:18 -0700
                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-23 10:27 -0700
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-23 14:16 -0400
                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-23 12:17 -0700
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-23 18:00 -0400
                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-23 22:30 -0700
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-24 05:45 -0400
                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-26 02:10 -0700
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-26 05:43 -0400
                Re: problem saving date fields Co <vonclausowitz@gmail.com> - 2011-05-23 14:26 -0700
                Re: problem saving date fields Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-23 18:01 -0400
                Re: problem saving date fields Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-23 23:59 +0200
                Re: problem saving date fields "Twayne" <nobody@devnull.spamcop.net> - 2011-05-22 09:11 -0400

csiph-web