Welcome Guest, Not a member yet? Register   Sign In
Please help me this code :()
#2

[eluser]giaodn[/eluser]
You shouldn't save the full path of uploaded images to DB, only need save the file name instead. I assume your project structure like figure below:

<project_name>
|---&gt;systems
|---&gt;css
|---&gt;uploads

... and the uploads folder is use to store the images after upload.

After upload, you get the file name of uploaded image and save it to DB as the below code:
Code:
$upload_data = $this->upload->data();
$file_name = $upload_data['file_name'];

// insert $file_name to DB code...

Now you can draw the images to the view like below pseudo-code:
Code:
$file_name = retrive_form_db();
<img src="&lt;?base_url() . 'uploads/' . $file_name ?&gt;"></img>

Hiểu chưa? Nếu chưa hiểu thì tớ giải thích bằng tiếng Việt cho Big Grin


Messages In This Thread
Please help me this code :() - by El Forum - 06-22-2007, 02:42 AM
Please help me this code :() - by El Forum - 06-22-2007, 03:14 AM
Please help me this code :() - by El Forum - 06-22-2007, 03:23 AM
Please help me this code :() - by El Forum - 06-22-2007, 04:23 AM
Please help me this code :() - by El Forum - 07-23-2009, 04:34 AM
Please help me this code :() - by El Forum - 07-07-2011, 03:37 AM
Please help me this code :() - by El Forum - 02-27-2012, 01:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB