Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    Ok, my table has a row that includes a date. It's formatted as a 6 digit date, and whenever i edit rows in phpMA, it decides it wants to change the date to the current time.

    I found this to be because it has the NOW function defaulted in said column. Is there anyway to change this so that it does not try to automaticaly update the date? which files should i edit so that i dont have to set NOW to " " every time i edit a row in this table?
    If its not in Family Guy its not worth it.

  2.  

  3. #2
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    Ok, my table has a row that includes a date.
    What is "my table"? Is it a MySQL table?

    If so, I had a similar problem when editing rows that contained the timestamp() function. The stored date always got reset to the current time. The way I solved it was to first extract all the columns (including the time) in the row I was about to edit. I use a form to enter my changes. In the same form I include a hidden field containing the original extracted time, which I store in a variable.

    When updating the row with the new edited data, I just reinsert the time stored in the temporary time-variable. That way the stored time remains the same.

    Code:
    $sql="UPDATE table_name SET text=$_POST['variable_name'], time=$_POST['time'] WHERE ID=$_POST['id']";
    S. Rosland

  4. #3
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    well im using phpmyadmin so i dont have to code my own editing page, but all im saying is when i try to edit any row in this mysql table, phpmyadmin sets all the colunms that include dates to the current time. Everytime i go to edit, i need to tell it not to update each and everydate.
    If its not in Family Guy its not worth it.

  5. #4
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    If your using PHPMyAdmin, its very easy.

    I have a norwegian version of the program, but I assume your toolbars will be named something similar to below.

    Open the database containing your table, and select the table you want to edit. In the panel that pops up, select the second tab from the left (called "view" I guess).
    Click the pen and paper symbol outside the row you want to edit. In the new edit window that pops up, select the pulldown menu beside your timestamp column that appears in the column section named "function". This is in your case set to "NOW". Alter it to "------". Go ahead an edit the row to your liking and execute.

    The content is now changed, and the timestamp remains the same as before. By altering "NOW" to "-------", you just tell the program not to alter anything in that column. It doesn't change your table in anyway, just that particular row for that particular edit session.
    S. Rosland

  6. #5
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    yse but i have to edit the function to ---- everytime i edit a row. I was asking if someone knows where in the actuall php file that builds the page i should edit so that it does not show 'now' as default
    If its not in Family Guy its not worth it.

  7. #6
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    Well you can't actually edit that, as that's not a function of phpmyadmin, but rather a replica of how your table is set up. In other words, its just showing you the column function for that particular table, as it's defined in mysql.

    If you want a row edit script where these things are automated, its much easier to construct your own for that specific purpose.
    S. Rosland


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:12 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com