close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Timestamp for dispalying recently updated listings

Thread began 7/17/2013 12:37 pm by jo271221 | Last modified 7/09/2015 4:51 pm by Ray Borduin | 441 views | 6 replies |

jo271221

Timestamp for displaying recently updated listings

I am using the field fldupdated in my database as a timestamp so that I can sort/view listings by the most recently updated.
Here is one page that I am doing this one. http://www.communityhotline.com/Member-Posts/ads-events-news-recently-updated.php?SI=&Search=1&theme=default

It appears that the database is getting updated by itself and listings that are NOT getting updated by the user are getting updated randomly in the database. Is this possible? The reason I think this is that there are some listings by users that have not been active for a long time whose listings are appearing at the top of my recently updated page.

I have the fldupdated field in the create page as hidden. On my update page I have the same thing - <input type="hidden" name="fldupdated" id="fldupdated" value="<?php echo(str_replace('"', '&quot;', $row_WADAtbl_post['fldupdated'])); ?>" size="32" />

Thanks!

Sign in to reply to this post

Jason ByrnesWebAssist

I need more details.

using this on the update page for fldupdated column:

<input type="hidden" name="fldupdated" id="fldupdated" value="<?php echo(str_replace('"', '&quot;', $row_WADAtbl_post['fldupdated'])); ?>" size="32" />



would mean that the field value would not be able to change since it would always be set to use the value stored in the recordset?


The database should not be able to update itself, someone would need to access the users account to update the records.

you should contact the account owners to make sure they are not making the changes.

Sign in to reply to this post

jo271221

I contacted the hosting company as well and this was there response "It looks like your database is using myisam. Myisam updates a database by tables so what I believe is happening is that an entry is being updated and since that table is updated everything in that table is being marked as updated. You may want to check with a database administrator to see if there is a way around it."

Also I adjust the update page to <input type="hidden" name="fldupdated" id="fldupdated" value="" size="32" />

Sign in to reply to this post

Jason ByrnesWebAssist

thats not true, myisam will not update a date field in your table for all records when one record is updated.


the hidden element should be set to:

<input type="hidden" name="fldupdated" id="fldupdated" value="<?php echo(date("Y-m-d")); ?>" size="32" />

Sign in to reply to this post

jo271221

Thank you - Is there a way to get the time the post was updated verses just the date? I tried - <?php echo(date("Y-m-d-H:i:s")); ?> and then nothing updated.

Sign in to reply to this post

Ray BorduinWebAssist

You need to use a space and not a dash between the date and time like:

<?php echo(date("Y-m-d H:i:s")); ?>

Sign in to reply to this post

jo271221

That worked perfectly. Thank You!!

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...