database_query
Moderator: General Moderators
database_query
ok... I have a simple database query that looks for entrys that exactly match a date that is on a calendar. I want to set it up so i can repeat entrys (every year, week, etc.) but i dont know how to query 'part' of an entry in a db. Anyone want to help?
-
jammindice
- Forum Newbie
- Posts: 4
- Joined: Fri Jun 10, 2005 12:20 pm
- Location: MD, USA
ok, now what is the concat() function? how exactly does it work? I tried it and it didn't seem to work how i thought it would. Is there any way I can just do something like this:
I basically want the year part of the date to be random but I dont know how to do that.
Code: Select all
$date = "%-06-23";
$day_query_2 = mysql_query( "SELECT * FROM calendar WHERE received='$date' LIMIT $limit" );- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
How about the DAY() and MONTH() functions?
Code: Select all
WHERE DAY(received) = 23 AND MONTH(received) = 6hmm... giving me a MySQL error? Did I put it in wrong? I removed the "DAY()" function and it works but doesn't when I remove "MONTH()" function...
Code: Select all
$day_query_2 = mysql_query( "SELECT * FROM calendar WHERE MONTH(received)='$new_month_num' AND DAY(received)='$new_day' LIMIT $limit" );