Have an account? Sign in
Login  Register  Facebook
Accordion Problem. Can anyone help me?
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>";
?>
Started: September 22, 2011 Latest Activity: September 22, 2011 phpaccordion

is your problem with the server side or with the js side
September 22, 2011

i think you have to change the sql query, just get the news and sort it by date
September 22, 2011

Wait. my query will look the database if the date is similar it will display as one. And it works but when i implement accordion. It only flip 1 data by date. Example in November 15, 2010 it has 7 news. And November 14,2010 is 5. In that 7 news in November 15, 2010, it only flip one news. It only flips the first one. Same happen in November 14,2010.
September 22, 2011

I already this one get the news and sort it by date but it does not work. I think my accordion is the problem. Can you help me?
September 22, 2011

Your Answer

xDo you want to answer this question? Please login or create an account to post your answer