php - Generate html divs using javascript from based on databse -
is possible generate divs using javascript database? can me or give me link?
you need ajax same. need make php script output:
<?php $conn = mysqli_connect($host, $user, $pass, $data); $res = mysqli_query($conn, "select * `table`"); while (false != ($dat = mysqli_fetch_array($res)) { echo '<li>' . $dat[0] . '</li>'; } ?>
and in html, using jquery, can this:
$("#list").load("db.php");
and html should be:
<ul id="list"> <li>loading data...</li> </ul>
Comments
Post a Comment