file upload issue in book
This commit is contained in:
parent
a73f062a28
commit
94ebbb5793
@ -147,7 +147,14 @@ class Books extends BaseController
|
|||||||
$existing_images_record = $BooksModel->db->table('book_images')
|
$existing_images_record = $BooksModel->db->table('book_images')
|
||||||
->where(['book_id'=>$book_id,'isactive'=>1,'type'=>1])
|
->where(['book_id'=>$book_id,'isactive'=>1,'type'=>1])
|
||||||
->get()->getRow();
|
->get()->getRow();
|
||||||
|
|
||||||
|
if ($existing_images_record) {
|
||||||
$existing_image_id = $existing_images_record->book_img_id;
|
$existing_image_id = $existing_images_record->book_img_id;
|
||||||
|
} else {
|
||||||
|
// Handle the case when the record does not exist
|
||||||
|
$existing_image_id = null; // Or set it to an appropriate default value
|
||||||
|
}
|
||||||
|
|
||||||
$this->logger->info("Books: Image Name are Differ".$new_img_name." & ".$existing_img_name);
|
$this->logger->info("Books: Image Name are Differ".$new_img_name." & ".$existing_img_name);
|
||||||
## Step 6 : Different Image Name means removed on target folder using Unlink;
|
## Step 6 : Different Image Name means removed on target folder using Unlink;
|
||||||
if ($existing_image_id && $existing_img_name && is_file($img_path.$existing_img_name)) {
|
if ($existing_image_id && $existing_img_name && is_file($img_path.$existing_img_name)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user