JQuery mobile动态添加可折叠内容php

I am building a webapp with jquery mobile where I need to get data from external database and show that data as collapsible content.

<div data-role="collapsible" data-theme="b" data-content-theme="d" data-collapsed="true">
    <?php 


// display the results returned
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    printf('<h3><b> %s </h3> 
    <p> %s <p>',$row["OSO"], $row["AIKA"]);
}


        ?>

How can I make every H3 to appear as a collapsible content title? Now only the first is shown as a title and the rest are in the content section

You should make a new collapsible item for each entry if you want multiple headers...

<?php 
// display the results returned
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
<div data-role="collapsible" data-theme="b" data-content-theme="d" data-collapsed="true">
   <h3><?= $row["OSO"] ?></h3>
   <p><?= $row["AIKA"] ?><p>
</div>
<?php } ?>