svgmx5 Posted January 23, 2010 Share Posted January 23, 2010 What i have is a list of events, which are all stored on a database and are retrieve using php. The issue i'm having is that i want it so people can click on a month, like January and all the events for January will be displayed. I wrote a script but i'm not sure what i'm doing wrong that is not doing what i was hoping it was. So i hope someone here can point me to the right direction and look over my script to see what i'm doing wrong $sql = "SELECT * FROM workshops WHERE month='$month'"; $run = mysql_query($sql) or die(mysql_error()); $num = mysql_num_rows($run); while($fetch = mysql_fetch_assoc($run)) { $date = $fetch['date']; $title = $fetch['title']; $moderator = $fetch['moderator']; $location = $fetch['location']; $time = $fetch['time']; $cost = $fetch['cost']; Link to comment https://forums.phpfreaks.com/topic/189505-displaying-only-certain-items-in-a-sql-database/ Share on other sites More sharing options...
spfoonnewb Posted January 23, 2010 Share Posted January 23, 2010 It looks fine to me. What is it doing wrong? is there more to it? Link to comment https://forums.phpfreaks.com/topic/189505-displaying-only-certain-items-in-a-sql-database/#findComment-1000293 Share on other sites More sharing options...
svgmx5 Posted January 23, 2010 Author Share Posted January 23, 2010 yea sorry i forgot that part What is doing is just displaying all events, even those that are not on january Link to comment https://forums.phpfreaks.com/topic/189505-displaying-only-certain-items-in-a-sql-database/#findComment-1000295 Share on other sites More sharing options...
spfoonnewb Posted January 23, 2010 Share Posted January 23, 2010 Is $month defined, and what column type is the month stored in? is it stored as a number "01" or text "January"? Link to comment https://forums.phpfreaks.com/topic/189505-displaying-only-certain-items-in-a-sql-database/#findComment-1000297 Share on other sites More sharing options...
svgmx5 Posted January 23, 2010 Author Share Posted January 23, 2010 well month is stored as text and the type is varchar. Link to comment https://forums.phpfreaks.com/topic/189505-displaying-only-certain-items-in-a-sql-database/#findComment-1000557 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.