How would I make an accordion in JQuery that shows data from my mysql database using PHP. So I would like it to show the data by alphabetical order like this:
... So until the user clicks on the "A" it doesn't show the data and same for b and so on..
So far I have this :
using Which is not in an accordion. Can someone please help me get started on this. It will be really appreciated.
[Code]
<div id="accordion">
<font face="Calibri" style="italic" size='10px' color="white">
<?php
mysql_connect("host","user","pass!") or die("Could not connect to localhost");
mysql_select_db("db") or die( "Could not connect to database");
?>
<?php
$result = mysql_query("SELECT * FROM table ORDER BY name ASC");
echo "<div class='scroll'>";
while ($row = mysql_fetch_array($result))
{
echo "<div style='margin: 0 auto;'>
<span style='display:inline-block; width:200px; text-align:left;'>" . ucwords($row['name']) . "</span>
<span style='display:inline-block; text-align:left;'>" . ucwords($row['number']) . "</span>
</div>
<br>";
}
echo "</div>";
?>
</div>