0

I want to insert file in database how can i do it with codeigniter... Please note I don't want to store the path of the image. How can I store the image directly in the database?

Controller

class UserController extendes CI_Controller{
}

Model

class User extends CI_Model{
}
Will Vousden
  • 31,330
  • 9
  • 80
  • 92
Nilesh Mahajan
  • 577
  • 3
  • 16

2 Answers2

0

You can store images in table with LONGBLOB datatype in mysql. just try this- http://www.phpriot.com/articles/images-in-mysql

Suresh Kamrushi
  • 14,655
  • 12
  • 74
  • 87
0

I guess for a better speed in high range of image records, storing the path or image name in a table is much more effective than storing the image data itself. you need to store the filename or the file path as a varchar and upload the file using uoload library of codeigniter.. This makes the whole process much simpler..!

Reza Saberi
  • 7,002
  • 9
  • 45
  • 74