Click here to Skip to main content
15,897,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Here iam creating one BLOG site.My Requirement is In Front end i have these controls

Date:
Message:
Keywords:
Subject:
Submit(Button)

we entering all fields and press Submit The Data Will be Stored in DB and displays Only Message and Date.
Like
2014:
January
Febraury
March
.
.
.December

When we select january it shows the Messages in January month with Date Wise.
I hope you understand.pls help me
Posted
Comments
OriginalGriff 22-Nov-14 4:23am    
And?
What have you tried?
Where are you stuck?
What help do you need?
King Fisher 22-Nov-14 4:26am    
have you tried anything ?

1 solution

You would be selecting the rows for the posts in January, like this,

SQL
SELECT * FROM Posts WHERE MonthOfPost = 'January'


This is an example, to get the posts from the january month. To show them in an order, you can use ORDER BY clause, like this

SQL
SELECT * FROM Posts WHERE MonthOfPost = 'January' ORDER BY TimeOfPost


To show them in an descending order, you can use the DESC in the end of the query's ORDER BY clause.
 
Share this answer
 
Comments
benzimen 22-Nov-14 7:46am    
Thank you for your reply.but in my Table i have only Date column,there is no column for Month.Here i will display the month names based upon the Date.how can i do it?
give me reply.
Afzaal Ahmad Zeeshan 22-Nov-14 7:47am    
You can check it as BETWEEN {start of january date} AND {end of january date} :-)

Have a look at this link please, http://www.w3schools.com/sql/sql_between.asp

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900