Welcome Guest, Not a member yet? Register   Sign In
Form field data pulled from database
#15

[eluser]jedd[/eluser]
[quote author="mdcode" date="1237343455"]
Model:
Code:
function get_customers()
    {
        /* customer selection query */
        $this->db->select('*');
        $this->db->from('customers');
        $this->db->order_by("customerName", "ASC");
        $cust_query = $this->db->get();
        
            foreach ($cust_query->result_array() as $row)
            {
            $row['customerid'];
            $row['customerName'];
            }
            
        return $cust_query;
    }
[/quote]

Okay .. what do you believe your indented foreach code there will actually do? I mean, what's the intent of that block, and do you think it delivers?


I suggested using arrays as they're easier for people who aren't used to dealing with objects or AR approaches - so you either need to assign those $row data above to a new array variable and return that OR use the $query->result_array() in the original call (and replace the ->db-> style AR calls) at the same time, OR you modify your view to cope with cycling through an object rather than an array.

Any of these options are open to you - so you pick which one you like the sound of the most, and we'll move forward with that one. At the moment I feel we're trying multiple approaches to the one basic problem.


Messages In This Thread
Form field data pulled from database - by El Forum - 03-16-2009, 06:54 PM
Form field data pulled from database - by El Forum - 03-16-2009, 07:09 PM
Form field data pulled from database - by El Forum - 03-16-2009, 07:28 PM
Form field data pulled from database - by El Forum - 03-16-2009, 07:49 PM
Form field data pulled from database - by El Forum - 03-16-2009, 07:55 PM
Form field data pulled from database - by El Forum - 03-16-2009, 07:56 PM
Form field data pulled from database - by El Forum - 03-16-2009, 08:04 PM
Form field data pulled from database - by El Forum - 03-16-2009, 08:12 PM
Form field data pulled from database - by El Forum - 03-16-2009, 08:24 PM
Form field data pulled from database - by El Forum - 03-16-2009, 09:23 PM
Form field data pulled from database - by El Forum - 03-16-2009, 09:58 PM
Form field data pulled from database - by El Forum - 03-16-2009, 11:17 PM
Form field data pulled from database - by El Forum - 03-17-2009, 03:14 AM
Form field data pulled from database - by El Forum - 03-17-2009, 03:30 PM
Form field data pulled from database - by El Forum - 03-18-2009, 06:17 AM
Form field data pulled from database - by El Forum - 03-18-2009, 07:58 AM
Form field data pulled from database - by El Forum - 03-18-2009, 04:17 PM
Form field data pulled from database - by El Forum - 03-18-2009, 05:38 PM
Form field data pulled from database - by El Forum - 03-18-2009, 06:51 PM
Form field data pulled from database - by El Forum - 03-18-2009, 07:10 PM
Form field data pulled from database - by El Forum - 03-18-2009, 07:22 PM
Form field data pulled from database - by El Forum - 03-18-2009, 07:44 PM
Form field data pulled from database - by El Forum - 03-18-2009, 09:00 PM
Form field data pulled from database - by El Forum - 03-18-2009, 09:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB