CodeIgniter Forums

Full Version: I added new function in DB_result.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I added this function in DB_result.php

function result_with_table_name() {
       $result = $this->result_id;
        while ($i < mysql_num_fields($result)) {          
            $fields[]=mysql_fetch_field($result, $i);
        while ($row=mysql_fetch_row($result)) {              
            for($i=0;$i<count($row); $i++) {
        return $return;

This function returns an array joining the table name and field name. This is very useful when we need to use "SQL JOIN" and some fields has the same name. Does codeigniter have already a similar function?