Welcome Guest, Not a member yet? Register   Sign In
Fetch Mode in CodeIgniter
#1

[eluser]magiclko[/eluser]
Hello

I was wondering if CodeIgniter support something like fetch modes. I mean, in like adodb e.g., we can set fetch mode to something say 'ADODB_FETCH_NUM' or 'ADODB_FETCH_ASSOC' . Actually, i am working on converting a web app in CI and initially, we have used ADODB. So, whenever i found something like setfetchmode('mode'); in there, i really get confused.

Any help will be greatly appreciated.
#2

[eluser]InsiteFX[/eluser]
Code:
const ADODB_FETCH_DEFAULT = 0;
const ADODB_FETCH_NUM     = 1;
const ADODB_FETCH_ASSOC   = 2;
const ADODB_FETCH_BOTH    = 3;

private $ADODB_FETCH_MODE;

public function set_fetch_mode($mode = NULL)
{
    $this->ADODB_FETCH_MODE = (int)$mode;
}

InsiteFX
#3

[eluser]magiclko[/eluser]
Hi

I am not using ADODB anymore in my web app. I am going CI way to handle Databases. My question is what CI equivalent would be of those adodb statements like $connection->SetFetchMode(ADODB_FETCH_ASSOC); ? I couldn't find much about fetch modes in CI, so maybe its like CI do it in some default way and no other options are given to user? Just a guess!
#4

[eluser]InsiteFX[/eluser]
Sorry, you would want to read the CodeIginter User Guide Database Active Record!

You will need to build your methods for the different things you will want to do with the database, but Active Record makes it easy.

InsiteFX
#5

[eluser]magiclko[/eluser]
I have, but it doesn't discuss/talk about fetching modes anywhere!




Theme © iAndrew 2016 - Forum software by © MyBB