Professional Web Applications Themes

phpmyadmin with NOW() timestamp field - MySQL

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 ...

  1. #1

    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.
    MozillaJoe Guest

  2. #2

    Default Re: phpmyadmin with NOW() timestamp field

    MozillaJoe 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.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  3. #3

    Default Re: phpmyadmin with NOW() timestamp field

    In article <com>,
    Jerry Stuckle <net> wrote:
     
     

    I wanted to do something vaguely remeniscent of this a while back, but
    never actually got around to it. I wondered whether it would be
    possible/sensible to use the timestamp as (part of) the key?

    Dave

    --
    Dave Stratford ZFCA
    http://daves.orpheusweb.co.uk/
    Hexagon Systems Limited - Experts in VME systems development

    Dave Guest

  4. #4

    Default Re: phpmyadmin with NOW() timestamp field

    In article <com>,
    Jerry Stuckle <net> wrote:
     

    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)?
    MozillaJoe Guest

  5. #5

    Default Re: phpmyadmin with NOW() timestamp field

    MozillaJoe wrote: 
    >
    > 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)?[/ref]

    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.
    net
    ==================
    Jerry Guest

Similar Threads

  1. updating one field with another (which contains a timestamp)
    By happysailingdude in forum Coldfusion - Getting Started
    Replies: 4
    Last Post: May 19th, 10:26 PM
  2. PhpMyadmin Help
    By hope@hope.com in forum PHP Development
    Replies: 6
    Last Post: March 23rd, 05:03 AM
  3. Ordering Timestamp field in SQL
    By fhilliard in forum Coldfusion - Advanced Techniques
    Replies: 3
    Last Post: March 8th, 10:40 PM
  4. int4 -> unix timestamp -> sql timestamp; abstime?
    By Roman Neuhauser in forum PostgreSQL / PGSQL
    Replies: 8
    Last Post: January 12th, 01:02 AM
  5. help with phpmyadmin
    By Matthew in forum PHP Development
    Replies: 3
    Last Post: January 19th, 02:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139