dmarchman Posted August 11, 2005 Share Posted August 11, 2005 i am working on a blog i made in dreamweaver and need some help 'cause i'm a MySQL n00b. I have a table in my db to store my blog entries (i named the table blogent) and when i enter a new blog a DATE field in that table named date_blogent that automatically stores the date i entered the blog in (with the date being stored as YYYY-MM-DD of course). I want to create links on a page that allow me to sort my blog entries by the month they were entered for example, i click on a link that says "July 2005" and the page filters through just the entries for that month. its probably something too simple and stupid for my feeble mind to comphrehend but any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/2444-this-is-probably-easy-to-solve/ Share on other sites More sharing options...
Mattyspatty Posted August 20, 2005 Share Posted August 20, 2005 i am working on a blog i made in dreamweaver and need some help 'cause i'm a MySQL n00b. I have a table in my db to store my blog entries (i named the table blogent) and when i enter a new blog a DATE field in that table named date_blogent that automatically stores the date i entered the blog in (with the date being stored as YYYY-MM-DD of course). I want to create links on a page that allow me to sort my blog entries by the month they were entered for example, i click on a link that says "July 2005" and the page filters through just the entries for that month. its probably something too simple and stupid for my feeble mind to comphrehend but any help would be appreciated. 265554[/snapback] using that date format, sorting just months may be a lil tough.. Quote Link to comment https://forums.phpfreaks.com/topic/2444-this-is-probably-easy-to-solve/#findComment-8158 Share on other sites More sharing options...
dmarchman Posted August 22, 2005 Author Share Posted August 22, 2005 i used my brain and figured it out myself. this is the easy way and requires a little more management than an db solution, but it works. first i made some links on a page with the month and year and then pointed them to another page and passed a parameter for example: june 2005 links to datesortbymonth.php?date_blogent=2005-06 then on the datesortbymonth.php page i made a recordset with the following query: SELECT * FROM blogent WHERE date_blogent LIKE '%colname%' ORDER BY date_blogent DESC and the following Variable: colname 1 $_GET['date_blogent'] basically in simple mode of the DW recordset dialog you set the filter keyword to "contains" as in date_blogent contains URL Parameter date_blogent. worked all good and purty. Quote Link to comment https://forums.phpfreaks.com/topic/2444-this-is-probably-easy-to-solve/#findComment-8173 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.