Bluehost.com Web Hosting $6.95

phpmyadmin with NOW() timestamp field

This is a discussion on phpmyadmin with NOW() timestamp field within the MySQL Database forums, part of the Database Forums category; I have a MySQL database that include a timestamp field, designed to set to NOW() whenever I update another field ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-25-2007
MozillaJoe
 
Posts: n/a
Default phpmyadmin with NOW() timestamp field

I have a MySQL database that include a timestamp field, designed to set
to NOW() whenever I update another field in that record (updates are
done manually by me, using phpmyadmin).

The purpose of this database is to track some fundraising a group I'm in
does, so the updates are typically when a donor sends a contribution in,
and the purpose of the timestamp field is to show when each donor's last
contribution was recorded.

I'd like to NOT have the timestamp field update sometimes, for example,
if I'm merely changing someone's email address or mailing address -
really, anything not related to them making a donation.

However, even though I used to know how to do this, I've forgotten.
What I *think* I should be doing is, when updating a record, use the
pulldown menu under "function" for the datestamp field, and change it
from NOW to the blank entry. But this doesn't work. I do this, and the
field updates to the NOW function (i.e., current date/time stamp).

So now I wind up copying the correct date/time using CTRL/C in the
timestamp field, updating the field(s) I want to update, saving the
changes, then having to go back in, paste the correct date/time back
into the timestamp field, save that, and then it's correct.

What SHOULD I be doing? Again, I want a way to update one or more
fields in a record using phpmyadmin, but WITHOUT having the
timestamp/NOW field changing from its previous setting.
Reply With Quote
  #2 (permalink)  
Old 04-25-2007
Jerry Stuckle
 
Posts: n/a
Default Re: phpmyadmin with NOW() timestamp field

MozillaJoe wrote:
> I have a MySQL database that include a timestamp field, designed to set
> to NOW() whenever I update another field in that record (updates are
> done manually by me, using phpmyadmin).
>
> The purpose of this database is to track some fundraising a group I'm in
> does, so the updates are typically when a donor sends a contribution in,
> and the purpose of the timestamp field is to show when each donor's last
> contribution was recorded.
>
> I'd like to NOT have the timestamp field update sometimes, for example,
> if I'm merely changing someone's email address or mailing address -
> really, anything not related to them making a donation.
>
> However, even though I used to know how to do this, I've forgotten.
> What I *think* I should be doing is, when updating a record, use the
> pulldown menu under "function" for the datestamp field, and change it
> from NOW to the blank entry. But this doesn't work. I do this, and the
> field updates to the NOW function (i.e., current date/time stamp).
>
> So now I wind up copying the correct date/time using CTRL/C in the
> timestamp field, updating the field(s) I want to update, saving the
> changes, then having to go back in, paste the correct date/time back
> into the timestamp field, save that, and then it's correct.
>
> What SHOULD I be doing? Again, I want a way to update one or more
> fields in a record using phpmyadmin, but WITHOUT having the
> timestamp/NOW field changing from its previous setting.


Actually, I would think you would want to track all of the donations
instead of just the last one.

For instance, another table with the donor id, amount and timestamp.
This would be separate from the rest of the info.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #3 (permalink)  
Old 04-25-2007
MozillaJoe
 
Posts: n/a
Default Re: phpmyadmin with NOW() timestamp field

In article <8eydndQMRKSnLrPbnZ2dnUVZ_uPinZ2d@comcast.com>,
Jerry Stuckle <jstucklex@attglobal.net> wrote:

> Actually, I would think you would want to track all of the donations
> instead of just the last one.
>
> For instance, another table with the donor id, amount and timestamp.
> This would be separate from the rest of the info.


Well, if it helps you answer my original question, I have fields _2007,
_2006, _2005, etc., for each calendar year, and those fields hold the
total donations someone made for that year.

There is another field, last_donation_date, type timestamp, that I have
showing the last time a donation was recorded for that person -
obviously, someone who gave on 12/31/2006 wouldn't want to receive a
fundraising appeal in January 2007, whereas someone who gave in 1/06
would be ready for a new appeal 12 months later.

So, to my original question: How, using phpmyadmin, can I update a
field or fields in a record, without having a timestamp field update as
well (i.e., the value in the timestamp field remains unchanged)?
Reply With Quote
  #4 (permalink)  
Old 04-25-2007
Jerry Stuckle
 
Posts: n/a
Default Re: phpmyadmin with NOW() timestamp field

MozillaJoe wrote:
> In article <8eydndQMRKSnLrPbnZ2dnUVZ_uPinZ2d@comcast.com>,
> Jerry Stuckle <jstucklex@attglobal.net> wrote:
>
>> Actually, I would think you would want to track all of the donations
>> instead of just the last one.
>>
>> For instance, another table with the donor id, amount and timestamp.
>> This would be separate from the rest of the info.

>
> Well, if it helps you answer my original question, I have fields _2007,
> _2006, _2005, etc., for each calendar year, and those fields hold the
> total donations someone made for that year.
>
> There is another field, last_donation_date, type timestamp, that I have
> showing the last time a donation was recorded for that person -
> obviously, someone who gave on 12/31/2006 wouldn't want to receive a
> fundraising appeal in January 2007, whereas someone who gave in 1/06
> would be ready for a new appeal 12 months later.
>
> So, to my original question: How, using phpmyadmin, can I update a
> field or fields in a record, without having a timestamp field update as
> well (i.e., the value in the timestamp field remains unchanged)?


That's a terrible design.

You should redesign your database (Google for "database normalization")
then write a application to access it. It's not that hard.

But for the way you're doing it, you might as well use an Excel
spreadsheet.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:24 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0