Welcome Guest, Not a member yet? Register   Sign In
small blog help needed passing data
#1

[eluser]echo sara[/eluser]
Hi

I am currently trying to make a small testing blog. Iam currently stuck on one line (getting a error) I need assistance figuring thats wrong with that line. I also need assistance on if it was coded right? can someone skim through it and see if it makes sense.
any advise is welcome as well.

my error was on line 16 on the model which is
Code:
if ($data_retrive->num_row()> 0) {

Controller
Code:
function entrytest($data) {
        $this->load->model('Entrymodel');
        $title = $this->input->post('title');
        $comment = $this->input->post('comment');
        $this->Entrymodel->sendentry($title, $comment);
        
        if($data > 0){
        
        echo $data;
        $this->load->view('blogentryview', $data);
        }
        else {
            echo "there was no blogs added";
        
        }
        
    }


Model
Code:
function sendentry($title, $comment) {
        
        $query_str = "INSERT INTO entries (title, body) Value ('{$title}', '{$comment}')";

        $this->db->query($query_str, array($title, $comment));
        
        $data_retrive = $this->db->get('entries');
        if ($data_retrive->num_row()> 0) {
            
            foreach($data_retrive->result() as $row){
                
                $data[] = row;
                echo $row->title;
                
            }
            return $data;
        }
                        
    }


Thank You!!!

Sara


Messages In This Thread
small blog help needed passing data - by El Forum - 08-11-2011, 05:06 PM
small blog help needed passing data - by El Forum - 08-11-2011, 06:30 PM
small blog help needed passing data - by El Forum - 08-12-2011, 05:58 AM
small blog help needed passing data - by El Forum - 08-12-2011, 08:06 AM
small blog help needed passing data - by El Forum - 08-12-2011, 01:30 PM
small blog help needed passing data - by El Forum - 08-12-2011, 03:26 PM
small blog help needed passing data - by El Forum - 08-12-2011, 03:31 PM
small blog help needed passing data - by El Forum - 08-12-2011, 04:02 PM
small blog help needed passing data - by El Forum - 08-12-2011, 04:39 PM
small blog help needed passing data - by El Forum - 08-12-2011, 05:04 PM
small blog help needed passing data - by El Forum - 08-12-2011, 05:15 PM
small blog help needed passing data - by El Forum - 08-12-2011, 05:31 PM
small blog help needed passing data - by El Forum - 08-12-2011, 05:42 PM
small blog help needed passing data - by El Forum - 08-12-2011, 05:46 PM
small blog help needed passing data - by El Forum - 08-12-2011, 05:48 PM
small blog help needed passing data - by El Forum - 08-12-2011, 06:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB