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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -