how to json_encode(); the Loop content so that the encoded array is [“0”:content, “1”:content]

Try outputting the JSON:

echo json_encode($dVC);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)