I am using ajax to fetch the data from database. There are about 20 records in database. Here is the php code to fetch the data.
$query = "SELECT user_id,website,emailid FROM job_posting where uid = ? order by date DESC";
$result = $mysqli->prepare($query);
$result ->bind_param("i",$uid);
$result->execute();
$result->store_result();
$result->bind_result($user_id,$website,$emailid);
if($result->num_rows >0){
while ($result->fetch()) {
$website = $website;
$emailid = $emailid;
$user_id = $user_id;
$data['content'][] = array(
'website' => $website,
'emailid' => $emailid,
'user_id' => $user_id,
);
}
$data['success'] = 'true';
}
echo json_encode($data);
}
Above code is working fine. I can see the data in json format. Sample below.
{"content":[{"website":"test.com","emailid":"[email protected]","user_id":1},{"website":"test.com","emailid":"[email protected]","user_id":2},{"website":"test.com","emailid":"[email protected]","user_id":3}],"success":"true"}
Now I want to show this data by angular in webpage.
Angular code:
$http({
url: 'get_details.php',
method: "GET",
params: {uid: uid}
})
.success(function(data) {
if (data.success) {
}
Please advise how to show the array data in a div.
<div class="col-md-12>
Need to show website, email id and user id in this div.
</div>