Gossamer Forum
Home : Products : DBMan : Customization :

How to list new records from the last x days.

Quote Reply
How to list new records from the last x days.
How can i get a list of records that were previously add in the last couple of days.

I have tried this code
Code:
<a href="$db_script_link_url&$db_key=*&mh=10&sb=13&so=descend&view_records=1">
Last 10 records added</a>
where mh equals the number of records i wish to show and sb = the field where the date is stored. But instead, it list ALL of the records. How can i get this to display correctly

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
Try my mod at http://www.jpdeni.com/dbman/whatsnew.txt



------------------
JPD





Quote Reply
Re: How to list new records from the last x days. In reply to
i got the new record code, i had to change date-gt to date, as it was in my cfg file. Now if i can just get the other code..LOL
THANKS!!!

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
No. Don't change "date-gt" to "date." If your field is called "date" use "date-gt." If it's called "Date" use "Date-gt." The "-gt" is absolutely required or you will only get results for the records that were added x days ago, not the ones that were added within the last x days.

I'll give you the other code when I can.


------------------
JPD





Quote Reply
Re: How to list new records from the last x days. In reply to
oh ok, i will change it then, Thanks very much

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
It doesn't work now, it doesn't display any records at all.

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
Do you get an error message?


------------------
JPD





Quote Reply
Re: How to list new records from the last x days. In reply to
NO, it just returns zero records.

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
You mean it doesn't say "No matching records" or "No search term defined"?

Try changing it to what you had before and see if it works.

Are you sure you have the datatype for your date field set to "date"?
------------------
JPD







[This message has been edited by JPDeni (edited August 01, 1999).]
Quote Reply
Re: How to list new records from the last x days. In reply to
yes, it says no matching records and the field is set to type date...

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
Could I see your database in action? I wouldn't need to have any permissions other than viewing.


------------------
JPD





Quote Reply
Re: How to list new records from the last x days. In reply to
OK the address for the site is http://akapa.hypermart.net and click the link for the directory

you can login as guest/guest

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
For some reason, you're "what's new" link has today's date on it. Did you set up the $days variable when you installed the mod?


------------------
JPD





Quote Reply
Re: How to list new records from the last x days. In reply to
yes , the $days variable is the first part of the html_home subprogram

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
Then I'll need to see your html.pl file. Can you make it available in a web-accessible directory?

(I don't recall whether I've asked you do this before. If you don't know how to make the file available, just ask and I'll let you know.)


------------------
JPD


[This message has been edited by JPDeni (edited August 01, 1999).]
Quote Reply
Re: How to list new records from the last x days. In reply to
ok, you can view the file in this directory

http://akapa.hypermart.net/script/html.pl

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
You'll need to copy the file to a directory where you would put html files and rename it so it has a .txt extension, like html_pl.txt. When I tried to access it to read it, it tried to run the script instead of showing it.


------------------
JPD





Quote Reply
Re: How to list new records from the last x days. In reply to
ok, it should work now


------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
Now I get a 404 error, with both html.pl and html_pl.txt. Could you give me the URL again, please?


------------------
JPD





Quote Reply
Re: How to list new records from the last x days. In reply to
go to http://akapa.hypermart.net/script/

the file is in that directory

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
I see it now.

Did you change sub get_date as is listed in the mod?

If you did and you're still having problems, try the fix at the end of the mod.

------------------
JPD


[This message has been edited by JPDeni (edited August 01, 1999).]
Quote Reply
Re: How to list new records from the last x days. In reply to
yes i did the change with get_date, what fix are you refering to?

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu
Quote Reply
Re: How to list new records from the last x days. In reply to
At the bottom of the mod page it says:

Quote:
# The above code should work just fine for you, but for some reason there have been a few
# people who couldn't get it to work. If you're having problems, take a look at the URL that
# results from clicking the link, especially the date that is after "Date-gt=" If that date is
# sometime in December 1969, you're going to need to do a little more work. (I still haven't
# figured out why this happens.
#

Now, your dates aren't in December 1969, but you are having a problem with getting the dates correct. So try the code at the bottom of the page at http://www.jpdeni.com/dbman/whatsnew.txt and see if that works for you.

------------------
JPD





Quote Reply
Re: How to list new records from the last x days. In reply to
Funny how I had nothing before 1969, but now it works perfectly!!! i should have replaced it when i first installed the mod. THANK SO MUCH,


now to work on the other script....

------------------
Jonathan
jwilliam@umfort.cs.ecsu.edu