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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -