Welcome Guest, Not a member yet? Register   Sign In
[Problem] HTML Table Class
#5

[eluser]Sein Kraft[/eluser]
Yes yes ^^, I only insert the file name, not the file path.

Another fail...

Quote:Fatal error: Call to a member function view() on a non-object in E:\server\htdocs\libelula\system\application\controllers\imageboard.php on line 38

This function show the image in a simple page like "http://www.example.com/imageboard/view/1"

Controller:
Code:
function view($id)
    {    
        $data['id'] = $id;
        $this->model_imageboard->view($data);
        
        $data = array(
                        'view_title' => '$image',
                        'view_heading' => 'Heading',
                        'view_image' => $this->model_imageboard->view()
                     );

        $this->parser->parse('view_imageboard_view', $data);
        
        $this->table->clear();
    }
Model:
Code:
function view($data)
    {
        
        $query = $this->db
        ->select('id, user_id, file_name')
        ->from('imageboard_image')
        ->where('$data['id']')
        ->get();
        
        if ($query->num_rows() > 0)
          {
            $rows = $query->result_array();
            foreach($rows as $row):
            $image = '<img src="http://127.0.0.1/CI/images/'.$row['file_name'].'" title="'.$row['id'].'" >';
            endforeach;
            return $image;
          }
          else
          {
        return false;
          }
    }


Messages In This Thread
[Problem] HTML Table Class - by El Forum - 09-12-2008, 08:33 PM
[Problem] HTML Table Class - by El Forum - 09-13-2008, 03:12 AM
[Problem] HTML Table Class - by El Forum - 09-13-2008, 06:47 AM
[Problem] HTML Table Class - by El Forum - 09-13-2008, 11:58 AM
[Problem] HTML Table Class - by El Forum - 09-13-2008, 12:36 PM
[Problem] HTML Table Class - by El Forum - 09-13-2008, 12:48 PM
[Problem] HTML Table Class - by El Forum - 09-13-2008, 12:51 PM
[Problem] HTML Table Class - by El Forum - 09-13-2008, 02:36 PM
[Problem] HTML Table Class - by El Forum - 09-13-2008, 03:06 PM
[Problem] HTML Table Class - by El Forum - 09-13-2008, 03:39 PM
[Problem] HTML Table Class - by El Forum - 09-13-2008, 08:29 PM
[Problem] HTML Table Class - by El Forum - 09-14-2008, 02:06 AM
[Problem] HTML Table Class - by El Forum - 09-14-2008, 06:44 AM
[Problem] HTML Table Class - by El Forum - 09-14-2008, 03:53 PM
[Problem] HTML Table Class - by El Forum - 09-14-2008, 05:00 PM
[Problem] HTML Table Class - by El Forum - 09-14-2008, 09:40 PM
[Problem] HTML Table Class - by El Forum - 09-14-2008, 10:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB