Hi guys, I have my code and it works of filtering data by Month and year.But it seems i got a problem when using accordion. i am kinda stack of it. Can anyone please help me out? This is my codes.

What i want to happen is like this.

getpinoy just click this link so that you can see what i mean for a detailed.

For now, i created it manually but i want to make it automatically.If you click the dates in brown area it will display the news with that month. Can anyone help me out?I only have problem in accordion.

**This is my codes:**

$year = $_REQUEST['year'];
    	$month = $_REQUEST['month'];
    	$last_date = "";
    	$result = mysql_query("SELECT *, YEAR(local_date) as year, monthname(local_date) as month FROM tbl_localnews where year(local_date)='".$year."' AND monthname(local_date) = '".$month."'  ORDER BY local_date DESC "); 
    
    	echo "<div class='mid_4_a_maincontent'>";
    	
    	while ($row = mysql_fetch_array($result)) {
    	echo "<div id=\"accordion\">";
    	$global_dates = $row['local_date'];
    
    	   if ($global_dates != $last_date) {
    	   echo "<h3 class=\"update\">";
           echo "<em>News for ".$global_dates."</em>";
           echo "<em style=\"font-size:12px; float:right;\">Updated ".$global_dates."</em>";
    	   echo "</h3>";
    	   $last_date = $global_dates;
    	   }
    	
    	echo "<div class='mid_4_a_maincontent_newsarea'>";
    	echo "This is my description";
    	echo "</div>";
    		
    	}	
       mysql_free_result($result); 
       echo "</div>";
    ?>

Recommended Answers

All 3 Replies

Your link isn't valid (404 error)

Your link isn't valid (404 error)

This is the the link. sorry. getpinoy

Better to consult good programmer of company for such problems

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.