i use jquery ui js.
When i return result i am doing this:
$stmt = $dbh->prepare('SELECT id,value FROM `table` WHERE `column` LIKE :keyword');
$keyword = "%".$data."%";
$stmt->bindParam(':keyword', $keyword, PDO::PARAM_STR);
$stmt->execute();
while ($user = $stmt->fetch(PDO::FETCH_ASSOC)) {
$user['value']=htmlentities(stripslashes($user['column']));
$user['id']=(int)$user['id'];
$user_set[] = $user;
}
And the returned array:
[{"id":1,"column":"user","value":"user"}]
I just set $user[id] and $user['value'], but there are three things returned , why?
Greetings!