rvdveen27 Posted May 8, 2015 Share Posted May 8, 2015 Hello all,First of all, I'm fairly new to this. I had some (very) basic experiences with HTML/CSS/PHP/MySQL. I've recently bought a CMS package called TruckNet which was created for Euro Truck Simulator 2 Multiplayer, to simulate VTC's (Virtual Trucking Companies). The CMS package was created by StuartD and after buying it I'm free to change it to my own wishes. I saw this a nice to chance to create something for what I like to do and as well learning some new things. I would like to issue a query on my database that gets results based on the current month. Now I know how to get that information from the database, however I have no idea how I could tell a query to filter the results matching to the current month and how could I let the query/database know what the current month is without having to change it manually? Link to comment Share on other sites More sharing options...
justsomeguy Posted May 11, 2015 Share Posted May 11, 2015 How is the time for each result stored in the database? What data type is used for the column? Link to comment Share on other sites More sharing options...
rvdveen27 Posted May 22, 2015 Author Share Posted May 22, 2015 Time is stored in the following way: Which results in: Link to comment Share on other sites More sharing options...
justsomeguy Posted May 26, 2015 Share Posted May 26, 2015 Here's the list of date and time functions:https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.htmlYou can use those to get the month and year, for example, of the dates in that column and compare them with the current month and year (from CURDATE or NOW). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now