Hey again.
Take this part out of your codes:
Code:
if($result > 0)
{
//$propertyImgUpload = uploadImages($result);
$this->session->set_flashdata('success', 'Thank you for submiting your property with us!, Our team will contact you shortly');
}
else
{
$this->session->set_flashdata('error', 'Submission of property failed, Contact [email protected]');
}
And add $result= here, just before the
$this->property_model->addPropertyImgs($imgData);
Code:
if(move_uploaded_file($tempFile, $targetFile))
{
$result = $this->property_model->addPropertyImgs($imgData);
}
and then run checking
Code:
if($result)
{
//$propertyImgUpload = uploadImages($result);
$this->session->set_flashdata('success', 'Thank you for submiting your property with us!, Our team will contact you shortly');
}
else
{
$this->session->set_flashdata('error', 'Submission of property failed, Contact [email protected]');
}
In short, 2 $result variables will check for the same result.