I was able to take the field name from the table using array_keys()
but if the query results are empty, array_keys()
can not be used.
is there any other way that I can take the name of the field even if the result is empty?
Query i used:
SELECT m.nama_user, m.nama_login, m.email, m.tgl_expired, m.password_web, gu.ucode_grp, gu.nama_grp_user
FROM tb_m_user m
LEFT OUTER JOIN tb_m_grp_user gu
ON m.ucode_grp=gu.ucode_grp
WHERE id_user=10