MySQL interesse |
|
print '<script src="http://code.jquery.com/jquery-latest.js"></script>';
//query definieren
$query = ($lang == "EN") ? 'SELECT faq_EN as faq FROM faq, answer_EN as answer' : 'SELECT faq, answer FROM faq' ;
//query uitvoeren
$res = mysqli_query(&$link, $query);
$i = 0;
//query fetchen
while($row = mysqli_fetch_assoc($res))
{
//gegevens displayen
print '
<br />
<div class="paragraph" style="padding: 0px; margin: 0px;">
<h2 id="h2t'.$i.'" style="cursor: pointer; padding: 0px; margin: 0px;">'.ucfirst($row['faq']).'</h2>
<div class="text" style="padding: 0px; margin: 0px;;">
<p style="display: none; margin-left: 20px;" id="ans'.$i.'" class="hide" ><i>'.ucfirst($row['anwser']).'</i></p>
</div>
</div>
<script>
$("#h2t'.$i.'").click(function () {
$(".hide").css("display", "none");
$("#ans'.$i.'").toggle();
});
</script>';
$i++;
print '<script src="http://code.jquery.com/jquery-latest.js"></script>'; //query definieren $query = ($lang == "EN") ? 'SELECT faq_EN as faq FROM faq, answer_EN as answer' : 'SELECT faq, answer FROM faq' ; //query uitvoeren $res = mysqli_query(&$link, $query); $i = 0; //query fetchen while($row = mysqli_fetch_assoc($res)) { //gegevens displayen <br /> <div class="paragraph" style="padding: 0px; margin: 0px;"> <h2 id="h2t'.$i.'" style="cursor: pointer; padding: 0px; margin: 0px;">'.ucfirst($row['faq']).'</h2> <div class="text" style="padding: 0px; margin: 0px;;"> <p style="display: none; margin-left: 20px;" id="ans'.$i.'" class="hide" ><i>'.ucfirst($row['anwser']).'</i></p> </div> </div> <script> $("#h2t'.$i.'").click(function () { $(".hide").css("display", "none"); $("#ans'.$i.'").toggle(); }); </script>'; $i++;
Items komen wel tevoorschijn alleen als ik de vraag klik komt er geen antwoord tevoorschijn.
|