Nested Loop in table PHP -
hello new php , trying make table using 2 foreach , not getting output want.
<html> <head> <title>didier test</title> </head> <body> <h1>yesso!</h1> </body> <table border="1"> <tr> <th>books</th> <th>price</th> </tr> <tr> <?php foreach($name $item): ?> <td><?=$item?></td> <?php foreach($price $item2): ?> <td><?=$item2?></td> </tr> <?php endforeach; ?> <?php endforeach; ?> </table> </body> </html>
i know having issue inner foreach, don't know how correct it.
please let me know thanks
well 1 thing closing body tag on line 7, before output table.
<body> <h1>yesso!</h1> </body>
i don't know why doing nested loop on seemingly non-related data. other need see query.
Comments
Post a Comment