Welcome Guest, Not a member yet? Register   Sign In
How to get file name to be inserted to database ?
#7

[eluser]ciGR[/eluser]
Have you create the model?
In model you must have create the appropriate functions.

For example,

Code:
class Model_name extends Model {

    function __construct()
    {
        parent::Model();
    }

    function save_image($image_name = '')
    {

        $this->db->insert('your_table_name',Array('image'=>$image_name));
    }
}

and in your controller after successful image upload you must load the model and call the function with the image name like the argument
Code:
$this->load->model('Model_name');
$this->Model_name->save_image($file_name);


Messages In This Thread
How to get file name to be inserted to database ? - by El Forum - 02-14-2010, 10:26 AM
How to get file name to be inserted to database ? - by El Forum - 02-14-2010, 10:56 AM
How to get file name to be inserted to database ? - by El Forum - 02-14-2010, 06:22 PM
How to get file name to be inserted to database ? - by El Forum - 02-14-2010, 06:35 PM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 07:19 AM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 07:27 AM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 07:30 AM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 07:32 AM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 08:34 AM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 08:40 AM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 08:43 AM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 09:17 AM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 09:21 AM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 09:35 AM
How to get file name to be inserted to database ? - by El Forum - 02-15-2010, 09:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB