Welcome Guest, Not a member yet? Register   Sign In
Multiple MySql insert problem
#6

[eluser]polish[/eluser]
When I add 3 tags print_r($data); give me:

Code:
Array ( [ttags_id] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [nnews_id] => 27 )

When I add 1 tag:

Code:
Array ( [ttags_id] => 1 [nnews_id] => 27 )

For help this is my controller function:

Code:
function add_tags() {
    $this->load->helper('form1');            
    $news_id = $this->uri->segment(3);
    IF(isset($news_id) and is_numeric($news_id))
    {
    $data["tagi"] = array('name' => 'tagi');
    
    $rules['tagi'] = "required|xss_clean";
    $this->validation->set_rules($rules);
    
    if ($this->validation->run() == FALSE)
        {
        $data['tagi']['value'] = $this->input->post('tagi');
        $this->response['content'] = $this->load->view('tagi/tagi_add', $data, True);
        }
    else
        {
        $this->Tagi->tagi_add(array('ttags_id' => $this->input->post('tagi'), 'nnews_id' => $news_id));
        $this->response['content'] = '<h1><center>Tag(i) przypisano</center></h1>&lt;META HTTP-EQUIV="Refresh" CONTENT="1; URL='.site_url('comment/show/'.$news_id).'"&gt;';
        }
    }
    else
        {
        $this->response['content'] = '<h1><center>Błędny Link</center></h1>&lt;META HTTP-EQUIV="Refresh" CONTENT="1; URL='.site_url().'"&gt;';
        }    
    $this->response['right'] = $this->load->view('tagi/tagi_right', '', True);
    $this->load->view('index', $this->response);
    }


Messages In This Thread
Multiple MySql insert problem - by El Forum - 06-18-2009, 09:24 AM
Multiple MySql insert problem - by El Forum - 06-18-2009, 09:34 AM
Multiple MySql insert problem - by El Forum - 06-18-2009, 09:36 AM
Multiple MySql insert problem - by El Forum - 06-18-2009, 09:54 AM
Multiple MySql insert problem - by El Forum - 06-18-2009, 10:13 AM
Multiple MySql insert problem - by El Forum - 06-18-2009, 10:38 AM
Multiple MySql insert problem - by El Forum - 06-18-2009, 11:01 AM
Multiple MySql insert problem - by El Forum - 06-18-2009, 11:58 AM
Multiple MySql insert problem - by El Forum - 06-18-2009, 05:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB