Hi,
I've been working on making my own FAQ system for my site with PHP & MySQL, I have the SQL displaying properly on the page but I cant seem to figure out how to make it so when the page loads just the questions show and when a question is clicked the answer shows below it. I've read a number of tutorials and when I do get it to work it will only show the answer to the first question when the link is clicked.
Here is the code I'm using to display the info from the database:
<div id="faqSQL">
<?php foreach($result as $option) { ?>
<div class="faq-question"><?php echo wordwrap($option['faqquestion'], 100, "\n", false);?></div>
<div class="faq-answer"><?php echo wordwrap($option['faqanswer'], 100, "\n", false);?></div>
<?php } ?>
</div>
If anyone can help it would be much appreciated.