on-internet
← Community

Display query result's single row of data in CodeIgniter view using array syntax [duplicate]

Stack Overflow ·

Let's say the query from my controller is $query. How can I display the data other than using this kind of code? foreach ($query as $row) { echo $row->student_id; } Any other than this because the query only has one row. Any way that can I access the returned array like this? $query['student_id'];

Comments

Sign in or sign up to comment and upvote.

No comments yet.