Forums
This topic is locked
Tutorial in Dreamweaver MX
Posted 02 Feb 2005 15:01:46
1
has voted
02 Feb 2005 15:01:46 Mashkur Alam posted:
HiWondering, does any one know, is there any tutorial HOW TO MAKE LATEST NEWS Database?
I wanted show, last 5 (dated + time) recorsd from database to my clients, everytime the database update.
Hope any friends can advice me, where I can find a tutorial on that. Help would be realy appreciated.
Babu
Replies
Replied 02 Feb 2005 15:46:08
02 Feb 2005 15:46:08 Vince Baker replied:
Using dreamweaver, you can create a recordset returning all of your news items and order them by the date descending: e.g.
Select *
from your_table_name
Order by your_date_field DESC
Then, when this is created, you can use the option on dreamweaver to add a repeat region but only show the first 5 records.
Is that what you were after?
Regards
Vince
DMX Talkzone Manager
Visit my home: www.chez-vince.com
(Now completely CSS based and bye bye to all tables!)
VBScript | ASP | HTML | CSS | SQL | Oracle | Hosting
Select *
from your_table_name
Order by your_date_field DESC
Then, when this is created, you can use the option on dreamweaver to add a repeat region but only show the first 5 records.
Is that what you were after?
Regards
Vince
DMX Talkzone Manager
Visit my home: www.chez-vince.com
(Now completely CSS based and bye bye to all tables!)
VBScript | ASP | HTML | CSS | SQL | Oracle | Hosting
Replied 02 Feb 2005 15:49:50
02 Feb 2005 15:49:50 Mashkur Alam replied:
Hi Vince,
Adjactly this what I am looking after, but one more question -
How can I show the last updated 5 records. Which will return my latest products.
Thanks again
Babu
Adjactly this what I am looking after, but one more question -
How can I show the last updated 5 records. Which will return my latest products.
Thanks again
Babu
Replied 02 Feb 2005 15:59:47
02 Feb 2005 15:59:47 Vince Baker replied:
If you place a date field in the table then you can use that to filter using the ORDER BY command DESC (Descending order) so that way your first 5 records returned will be the latest ones...
Alternatively, if you are using an incremental record ID then you could order by desc on that field (5,4,3,2,1 etc)
Regards
Vince
DMX Talkzone Manager
Visit my home: www.chez-vince.com
(Now completely CSS based and bye bye to all tables!)
VBScript | ASP | HTML | CSS | SQL | Oracle | Hosting
Alternatively, if you are using an incremental record ID then you could order by desc on that field (5,4,3,2,1 etc)
Regards
Vince
DMX Talkzone Manager
Visit my home: www.chez-vince.com
(Now completely CSS based and bye bye to all tables!)
VBScript | ASP | HTML | CSS | SQL | Oracle | Hosting
Replied 02 Feb 2005 15:59:50
02 Feb 2005 15:59:50 Dave Thomas replied:
u could have a checkbox field in your database table which checks if your table has been updated or not.
then a simple if/else statement based on whether the checkbox is "true" determines if the records are displayed.
regards
Dave
then a simple if/else statement based on whether the checkbox is "true" determines if the records are displayed.
regards
Dave
Replied 02 Feb 2005 16:02:45
02 Feb 2005 16:02:45 Vince Baker replied:
Reference my last post, not sure if i totally understood.......best if you use the date when the amendment was made, that way when you order the recordset you will get the last 5 records edited by date edited order....
Regards
Vince
DMX Talkzone Manager
Visit my home: www.chez-vince.com
(Now completely CSS based and bye bye to all tables!)
VBScript | ASP | HTML | CSS | SQL | Oracle | Hosting
Regards
Vince
DMX Talkzone Manager
Visit my home: www.chez-vince.com
(Now completely CSS based and bye bye to all tables!)
VBScript | ASP | HTML | CSS | SQL | Oracle | Hosting
Replied 02 Feb 2005 16:04:53
02 Feb 2005 16:04:53 Mashkur Alam replied:
Hi thanks
Here is the critic problem for me, can't right any logical statement, I don't know how to write the code, I am realy sorry, whatever I learnt, all from DMX, is there any source code path can you show me? So that I can understand, what kind of logical statement should I write.
Regards
Babu
Here is the critic problem for me, can't right any logical statement, I don't know how to write the code, I am realy sorry, whatever I learnt, all from DMX, is there any source code path can you show me? So that I can understand, what kind of logical statement should I write.
Regards
Babu
Replied 02 Feb 2005 16:09:30
02 Feb 2005 16:09:30 Mashkur Alam replied:
Hi Vince
Thanks again, Order means ascending, but it will not show the last updated, isn't it?
Dave is right, we need to add logical statement. To pick the latest 5.
Thanks
Babu
Thanks again, Order means ascending, but it will not show the last updated, isn't it?
Dave is right, we need to add logical statement. To pick the latest 5.
Thanks
Babu
Replied 02 Feb 2005 16:13:23
02 Feb 2005 16:13:23 Vince Baker replied:
I am making some assumptions here so can you confirm the following:
You have a table with records
You want to show the last 5 updated records.
What you could do:
Ensure a field is present in your table that holds a update_date.
When you update a record send the date/time to this field.
Filter your recordset using Order By update_date DESC (ASC will be ordered in ascending order, DESC will be descending order, i.e. the last 5 entered)
Only display 5 records from the repeat region and voila.
Regards
Vince
DMX Talkzone Manager
Visit my home: www.chez-vince.com
(Now completely CSS based and bye bye to all tables!)
VBScript | ASP | HTML | CSS | SQL | Oracle | Hosting
You have a table with records
You want to show the last 5 updated records.
What you could do:
Ensure a field is present in your table that holds a update_date.
When you update a record send the date/time to this field.
Filter your recordset using Order By update_date DESC (ASC will be ordered in ascending order, DESC will be descending order, i.e. the last 5 entered)
Only display 5 records from the repeat region and voila.
Regards
Vince
DMX Talkzone Manager
Visit my home: www.chez-vince.com
(Now completely CSS based and bye bye to all tables!)
VBScript | ASP | HTML | CSS | SQL | Oracle | Hosting
Replied 02 Feb 2005 16:19:54
02 Feb 2005 16:19:54 Mashkur Alam replied:
Hi Vince
<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Thanks, yes there is a field call last_update, So if your advice is right then it should work that way, I will give a try tonight.
Thanks both of you "Vince & Dave" GREAT<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Babu
<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Thanks, yes there is a field call last_update, So if your advice is right then it should work that way, I will give a try tonight.
Thanks both of you "Vince & Dave" GREAT<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Babu