Jump to content

displaying only certain items in a sql database


svgmx5

Recommended Posts

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'];

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.