Welcome Guest, Not a member yet? Register   Sign In
Normal PHP to Codeigniter
#3

(This post was last modified: 04-08-2020, 09:40 AM by jreklund.)

You need to fetch your results as an array with result_array() instead of result() as the paser want's an array and not an object.

https://codeigniter.com/userguide3/libra...arser.html
https://codeigniter.com/userguide3/datab...sults.html

PHP Code:
$alimente $this->db->query('select name as aliment from alimente')->result_array();
$content $this->parser->parse('alergeni_alimente/list', array('ALIMENTE' => $alimente), true);

{
ALIMENTE}
<
tr>
    <
td>{aliment}</td>

    <
td></td>
</
tr>
{/
ALIMENTE
Reply


Messages In This Thread
Normal PHP to Codeigniter - by Matt - 04-02-2020, 02:57 PM
RE: Normal PHP to Codeigniter - by Matt - 04-08-2020, 05:22 AM
RE: Normal PHP to Codeigniter - by jreklund - 04-08-2020, 09:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB