This is a discussion on creating a post made since last visit problem within the PHP Programming forums, part of the Web Development category; hi, on a news program i made i want to allow my members to see what new articles were made ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| hi, on a news program i made i want to allow my members to see what new articles were made since they last visited the site. pretty much what i want to do is exactly how phpbb and other bbs programs do. now looking at them i applied the same method but it doesn't seem to work. first off i added a column last_visit which would have the last time they visited the site(in time()) then i made it do a search with the following query: Code : SELECT * FROM metal_posts WHERE Date>='$last_visit' now doing it that displayed 0 results every time no matter what. changed >= to <= just displayed all of the news articles. so question is, what am i doing wrong? to let you know all the dates on my program are in time() format so format issue isn't the problem here. thanks |
|
#2
| |||
| |||
| Hi, Try to use date_format function of MySQL in your query, what you have to do is apply this function to both the dates being compared so that MySQL can apply the matching filter and show you the records. Also make sure that last_visit is also a complete time stamp i.e. date and time and not just time. Hope this helps. Cheers, Maneet |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I made a terrible mistake | rony321 | Computer Hardware | 0 | 01-10-2009 11:54 AM |
| Dental Healthcare Visit to Kerala | BonyAmi | The Lounge | 0 | 12-18-2007 11:11 PM |
| Any correlation between spiders visit &a | montyauto | PHP Programming | 0 | 04-07-2007 09:28 PM |
| Visit URL -> login -> extract link | oyu2o | PHP Programming | 0 | 03-10-2007 08:42 AM |
| Worst SEO mistakes you've made? | spid4r | Search Engine Optimization | 0 | 03-08-2007 11:34 PM |
Our Partners |