Sagar Gopale Sagar Gopale - 4 months ago 29
jQuery Question

showing php jsonencode array result into ajax success function

I am trying to show result of my php code to ajax file with jquery but i dont know how to do array [{"UPDATE_TIME":"2016-11-28 06:51:51"}] i want to show this result through ajax jquery.

header('Access-Control-Allow-Origin: *');

include_once "dbconfig.php";

FROM information_schema.tables
WHERE TABLE_SCHEMA = 'vizteyl7_tarining'
AND TABLE_NAME = 'news'";

$result = $conn->query($sql);

if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$output[] = $row;

echo json_encode($output);
} else {
echo "0 results";

<label>Enter TimeStamp (last updated date: <span id="lastTs"></span>)</label>


function setTs(){

type: "GET",
dataType: "json",
success: function(data) {



Try this...