Newbie. Why I didn't get JSON response?
<?php
include ('config.php');
$stringData = $_POST['dataString'];
$sql=mysql_query("SELECT * FROM comments WHERE post_id_fk='$stringData'");
while($row=mysql_fetch_array($sql))
{
$user=$row['user_id'];
$time=$row['time'];
$comment=$row['comment_content'];
$respond=array(
'user'=>$user,
'time'=>$time,
'comment'=>$comment
);
echo json_encode ($respond);
}
?>
I have this script and can't firgure out, what doesn't work here and why
response isn't JSON?
No comments:
Post a Comment