Good afternoon I'm trying to make a MySQLi query, that is, I want each row of the database to go into a separate div, I searched and did not find anything similar to what I think it gets in a difficult way to understand
HTML code
<div id="inicio" class="col-md-4 col-sm-4 col-xs-12 profile_details">
<div class="well profile_view">
<div class="col-sm-12">
<h4 class="brief"><i>Digital Strategist</i></h4>
<div class="left col-xs-7">
<h2 id="inicio"></h2>
<p><strong>About: </strong> Web Designer / UX / Graphic Artist / Coffee Lover </p>
<ul class="list-unstyled">
<li><i class="fa fa-building"></i> Address: </li>
<li><i class="fa fa-phone"></i> Phone #: </li>
</ul>
</div>
<div class="right col-xs-5 text-center">
<img src="../images/img.jpg" alt="" class="img-circle img-responsive">
</div>
</div>
<div class="col-xs-12 bottom text-center">
<div class="col-xs-12 col-sm-6 emphasis">
<p id="inicio" class="ratings">
<a>4.0</a>
<a href="#"><span class="fa fa-star"></span></a>
<a href="#"><span class="fa fa-star"></span></a>
<a href="#"><span class="fa fa-star"></span></a>
<a href="#"><span class="fa fa-star"></span></a>
<a href="#"><span class="fa fa-star-o"></span></a>
</p>
</div>
<div class="col-xs-12 col-sm-6 emphasis">
<button type="button" class="btn btn-success btn-xs"> <i class="fa fa-user">
</i> <i class="fa fa-comments-o"></i> </button>
<button type="button" class="btn btn-primary btn-xs">
<i class="fa fa-user"> </i> View Profile
</button>
</div>
</div>
</div>
</div>
JavaScript
$("document").ready(function() {
//CarregarFuncionarios
$.getJSON("../include/carrFunc.php", function(data) {
var items = [];
i = 0;
$.each(data, function(i) {
items.push("<option value='" + data[i].idFuncionario + "'>" +
data[i].nomeFunc + "</option>");
});
$("#inicio").append(items);
});
});
PHP
<?php
include "conexao.php";
$sql = "SELECT idFuncionario,nomeFunc FROM tbfuncionario;";
$result = $conn->query($sql);
$data = array();
if ($result->num_rows > 0) {
// output data of each row
$data = $result->fetch_all( MYSQLI_ASSOC );
//print_r ($data);
} else {
echo "Nenhum resultado encontrado.";
}
$conn->close();
//echo "<br>";
echo json_encode( $data );
?>