Welcome Guest, Not a member yet? Register   Sign In
mysql_fetch_assoc in CI
#1

[eluser]Mitja B.[/eluser]
Hello, i am searching in user guide and google but i can not find how can i use mysql_fetch_assoc in CI

This is my code


Code:
$query = $this->db->query("SELECT pool_id
                  FROM pool_question
                  WHERE active = 1
                  ORDER BY question_id DESC
                  LIMIT 1");

$row = mysql_fetch_assoc($result);
        
$maxID = $row['pool_id'];

How can i convert $row = mysql_fetch_assoc($result); in CI that i will still can use $maxID = $row['pool_id']. I found row_array but i do not know if this what i am searching for.

thx
#2

[eluser]xwero[/eluser]
Code:
$query = $this->db->query("SELECT pool_id
                  FROM pool_question
                  WHERE active = 1
                  ORDER BY question_id DESC
                  LIMIT 1");

$row = $query->row_array();

$maxID = $row['pool_id'];




Theme © iAndrew 2016 - Forum software by © MyBB