What is the equivilent make code igniter get and write all variables...
This is what I would usually do something like:
$get = mysql_query("SELECT * FROM aTable");
while($row = mysql_fetch_assoc) {
echo $row['someContent'];
}
How would I do this in codeigniter?
After running your query, using either ->query()
or the "active record" class' ->get()
, use the result_array
method.
$query = $this->db->query("SELECT * FROM aTable");
foreach($query->result_array() as $row){
echo $row['someContent'];
}
Docs: https://www.codeigniter.com/user_guide/database/results.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With