Written by me@grafxflow
28 Nov, 2012
3
7,111
This is a short snippet of php code if you want to use a CodeIgniter database query inside a helper file/function which is based in the following folder 'application/helpers/'.
<?php
// outputs the query results //
function array_output()
{
$ci=& get_instance();
$ci->load->database();
$sql = "SELECT *
FROM table";
$query = $ci->db->query($sql);
$row = $query->result();
return $row;
}
?>
24 Nov, 2013
07 Nov, 2012
26 Apr, 2018
I am a Full-stack Developer who also started delving into the world of UX/UI Design a few years back. I blog and tweet to hopefully share a little bit of knowledge that can help others around the web. Thanks for stopping by!
Follow11 Jul, 2023
21 Jun, 2023
25 Nov, 2022
20 Sep, 2022
Views: 162,261
Views: 38,655
Views: 34,327
Views: 31,730
3 Response
Darren
28 Sep 2013This worked perfectly!
me@grafxflow
28 Sep 2013Chinkush Varshney
16 Sep 2014