CodeIgniter Forums

Full Version: How to read files and insert into DB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello ,

i have a folder contain around 4000 file , i wanna use a codeiginter to read all these files and then insert the filename and file contain to database table .

i create the database table like :

id
filename
filecontant

thanks
You could easily do this using the directory helper and the file helper, but unless you need to monitor this directory and keep it up to date as a long-term feature of a website, I'm not sure why you would bother going through CodeIgniter to do this, rather than just writing a one-time script.
(08-27-2015, 06:42 AM)Gladiator_x Wrote: [ -> ]Hello ,

i have a folder contain around 4000 file , i wanna use a codeiginter to read all these files and then insert the filename and file contain to database table .

i create the database table like :

id
filename
filecontant

thanks

what it does mean "contain to database table", let me guess do you have folder around 4000 file then you need to store file name and also file contain, is it such as articles which writing in m word, am i correct ! if yes it such as articles it will not handle by codignter you should create common CRUD write file name and copy paste your container to text are then submit it! hope fully my guess not wrong sorry if i'm wrong