Jump to content

Collapsible links


elite311

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.