Codeigniter Image upload -


where can find tutorial concept uploading image , save image path in database user id , delete function. thanks!

here concept form

+--------+ +------------+ | avatar | |            | browse +--------+ +------------+   +----------+ |          |  name +----------+  +----------+ |          |  age   +----------+  +----------+ |          |  address +----------+   +----------+ |  submit  | +----------+ 

here 1 upload, database , delete should easy there

http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-file-uploading-and-image-manipulation/

also review codeigniter pages subject

also of note codeigniter: image upload

edit----------------------------------------

i assuming listing images in table edit or delete them. way off base doing. assuming while use "user id" assign id image itself.

for deletions this

$this->table->set_heading('date', 'title', 'delete', 'update');  foreach($records $row){ $row->title = ucwords($row->title);  $this->table->add_row( $row->date, anchor("main/blog_view/$row->id", $row->title),     anchor("main/delete/$row->id", $row->id, array('onclick' => "return confirm('are     sure want delete?')")), anchor("main/fill_form/$row->id", $row->id) ); } $table = $this->table->generate(); 

see second anchor? picks id of image in db , points controller function:

 function delete() {     $this->is_logged_in();     $this->post_model->delete_row();     $this->maint(); } 

the model

   function delete_row() {     $this->db->where('id', $this->uri->segment(3));     $this->db->delete('posts'); } 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -