close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

using database date

Thread began 5/08/2012 7:40 am by JamieEff | Last modified 5/17/2012 1:16 pm by JamieEff | 3480 views | 20 replies |

JamieEff

using database date

Hi Guys

On a blog, at the moment I have created a content area within the template for the user to add the blog date.

If I wanted to automate that and use the date for that a specific entry within the database itself, how would i go about it please?

Thanks

Jami

Sign in to reply to this post

Jason ByrnesWebAssist

set the default value for the date column to NOW()

this will cause the current date to be entered by default when a new record is created.

Sign in to reply to this post

JamieEff

thanks

Jamie

Sign in to reply to this post

JamieEff

Hey guys

Had a really good and informative premier support last night with Ray - thanks for that and all the info!

I have taken what Ray and I did last night and am trying to translate it over to another website.

I seem to have hit a bit of a wall in that the date that is being returned from the database is showing the most recent date for all 3 posts rather than the date that each one should have.

As you can see from the attached image (dates.jpg) there are 3 different dates in the database for the 3 different posts.

But in the screen shot of the list on the front end, although the titles are listed fine, the dates are only showing the date from the most recent post.

I have spent ages trying to trouble shoot this and fix this but am really struggling... I just dont know what I should be looking for to effect a fix and would really appreciate a steer.

Many thanks

Jamie

Sign in to reply to this post

Christopher WestCommunity Expert

Hi, wouldnt that attached image suggest you have your repeat region code slightly off on your page? since its not moving the repeat counter for the date part of your code. have you exmained the repeat region area on your page? perhaps its just the slightly line placement thats causing your issue?

Chris

Sign in to reply to this post

JamieEff

thanks for the reply Chris, am not really too sure to be honest. This is the area including the repeat region:

php:
<?php do { ?>
    <div id="newsList">
      <div id="newsDate">
        <?php
include('WA_CMS/addtosite.php');
echo(
date("d M Y",strtotime($row_LatestNewsRS['ContentDate']))); 
?>
        </div>
      <div id="newsTitle"> <a href="news-item.php?zzLatestNews=<?php echo $row_LatestNewsRS['ContentPageSetOrder']; ?>"">
        <?php
include('WA_CMS/addtosite.php');
echo 
str_replace(array("<p>","</p>"),"",WA_getCMSContent($database_PowerCMSConnection$PowerCMSConnection'zzLatestNews''Title'false$row_LatestNewsRS['ContentPageSetOrder'],80));
?>
        </a></div>
    </div>
    <?php } while ($row_LatestNewsRS mysql_fetch_assoc($LatestNewsRS)); ?>



if you have any thoughts as to what I am doing wrong would really appreciat it!

Thanks

Jamie

Sign in to reply to this post

Christopher WestCommunity Expert

Hi well I'm no expert yet but wouldnt it have something to do with having those 2 includes inside the loop? They are not include_once so that may cause problems depending what's contained in those includes. Have you tried putting them outside the loop?

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of your page please so i can see the code in context.

also a copy of the page ray worked on originally.

Sign in to reply to this post

JamieEff

Thanks Chris and Jason, I think I have fixed that problem (not 100% sure how though tbh!).

Have come up against a couple of other problems with it though.

Basically if you go to latest-news.php all 4 posts are visible with the correct date.

If you go to any of the results pages, then the date shown is always the most recent post regardless of whether you are viewing post 1 2 3 or 4....

Thats problem 1 and I know its something to do with the results page but cant figure out what or why

The second problem is that when you click on either of the news archive links in the top right panel you go through to the relevant months posts, but then when you go back to the main listing page (ie latest-news.php) it only shows the posts from the month that you looked at in archive....

If you need any of the code, just let me know which ones......

Thanks in advance for any and all help

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need these three pages to look into the problem.

news-archive.php
news-item.php
latest-news.php

Sign in to reply to this post
loading

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