MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completelly customizable, expandable and suitable for all needs.
     Site demo
IMPORTANT: Read THIS before posting your support question in the forum!
I'll be off-line until the second half of september, please do not insist asking support if there is nobody who can help you. The forum has the answers for almost all possible problems with MemHT Portal... use the search button and read documents! mem
Moderators: mem paulo89
RSSReply
How to get newer posts than ... for example mine last visit
AuthorText
daris
Junior Member
Avatar

Posts: 16
Gender: _MALE_
Online: No
Date: 17/04/2008 21:14
How to get newer posts than ... for example mine last visit
#post6261
I want to get all newer post than some date (for example mine last visit). How to do it?

SELECT id FROM memht_forum_posts WHERE date > some_date

I don't know how to compare date field
Edited: 17/04/2008 21:17
Sorry for my english Smile
Delete Edit Quote
 
paulo89
Moderator
Developer

Avatar

Posts: 853
Contributes: 48

Gender: _MALE_
Online: No

Version: 3.8.1
Country: Portugal
Languages: Portuguese and Portuguese ^^ and little English
Date: 17/04/2008 22:23
Re: How to get newer posts than ... for example mine last visit
#post6262
Hi

This will not work as you want, because you refresh the page and your last login is updated, but here's the same

First we have to get your last login:
code

        $lastlogin = $dblink->get_row("SELECT lastlogin FROM memht_utenti WHERE user='$user'");
        $lastlogin = $lastlogin['lastlogin'];
 


And now we get idīs
code

        $lastposts = $dblink->get_list("SELECT id FROM memht_forum_posts WHERE date < '$lastlogin'");
        foreach ($lastposts as $row_lastposts) {
        $id = intval($row_lastposts['id']);
        echo "$id<br>";
        }
 


For you see that the comparison working change the signal "<" for ">"
Image
Delete Edit Quote
 
Reply
Dreamhost memht2
Survey
Which PHP version do you use?
PHP 5
PHP 4
Other (comment)
Language
Quotes
"It's light, fast, secure plus best SEO. If compare to Dragonfly, Joomla, Drupal, PHPNuke. memht cms is the best. Once again, thanks for your hard work."
amerilao
CMS Award
Search
Users Block
Hi Guest
IP: 38.103.63.17

Username
Password
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo
Disclaimer and Privacy Policy - Newsletter
MemHT - MemHT - Miltenovik - ScripTips