Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord for CodeIgniter: Rails-style model interactions
#30

[eluser]sophistry[/eluser]
great! thanks for that helping hand...

I suggest using the gunter fix (in discover_table_columns fn) so it doesn't make multiple redundant queries to get columns.

EDIT... FIXED this problem! It was me. my search only returned one record when I thought it was a search that returned multiple records. Everything seems to be good now. more later.

also, now i've got another problem:

the object returned does not seem to give me access to all of the records when i do a find_all_by_ function.

EDIT... this code works fine...
Code:
<?php

class Addresses extends Controller {

    var $Address;
    
    function Addresses()
    {
        parent::Controller();
        $Address =& $this->load->model('Address');
    }
    
    function index()
    {
        echo "Welcome to my address list!";
        
    }
    
    function viewer($mb)
    {
        $addresses = $this->Address->find_all_by_mailbox($mb);
        print_r($addresses);
    }
}
?>

EDIT... fixed.
that just prints out a giant object and there is only one "record"represented in it.

how am i supposed to get multiple records if the class stamps them into the associative array? it seems like the records may be found but are not being "saved" into the returned object properly. maurice, any help here? i think there is still something wrong with the PHP4 rewrite and i'm digging around looking, but i'm a bit slower than you are!


Messages In This Thread
ActiveRecord for CodeIgniter: Rails-style model interactions - by El Forum - 09-24-2007, 03:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB