Welcome Guest, Not a member yet? Register   Sign In
Filling and array foreach loop
#1

[eluser]Michal1[/eluser]
Hello guys,

I have been working on one script and I am stuck at filling my array. What I have in my view is this code

Code:
$backlinkSources = array ();

foreach ($backlinkSources as $roww) {
    
    



$backlinkSources = array (
    'name_thems'=>$roww->name_them,
                          
                         );
                        
                        
                        
                         }

Then in my one controller function I have this array

Code:
$data = array(
            
            'name_them'=>$this->input->post('name_them')
            
                );
                
                $this->site_model->insert_data($data);

And basically what I want to do is to take that name_them in my site_view and pass it into that name_thems field
Code:
array $backlinkSources = array (
    'name_thems'=>  something

But it does not work. Does somebody know what am I doing wrong? Please answer me as easy as possible as I am a beginner.

Thank you


Messages In This Thread
Filling and array foreach loop - by El Forum - 03-04-2011, 04:34 AM
Filling and array foreach loop - by El Forum - 03-04-2011, 05:22 AM
Filling and array foreach loop - by El Forum - 03-04-2011, 05:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB