Welcome Guest, Not a member yet? Register   Sign In
$_FILES Array getting empty when using $this->form_validation->run()
#14

(06-12-2019, 01:45 AM)demyr Wrote: Probably you deleted one of the records before. So, if you are in a development period please go to phpmyadmin and clear the datas in the table. Then go to the Settings sections (top menu of phpmyadmin) and set AUTO_INCREMENT as 0, in order to start from 1, then try posting the form again.

(If I'm not wrong Auto_INCREMENET will be 0 for the start. If not, then insert 1 Smile )


The second option:  you can add+1 to your id within your php codes. But I'd go with the first one.

Finally I got The issue is with the database operations.

property_images table has fields - id,path,propertyid

propertyid is the last inserted id form the first query(Insert property details). But when i use the id to insert property images its not working.

I tried the propertyid as simply value then its working, When i use the propertyid as last inserted id which return after inserting the property details is not working.

Model

PHP Code:
function addNewProperty($propertyInfo)
 
     {
 
         $this->db->trans_start();
 
         $this->db->insert('tbl_properties'$propertyInfo);

 
         $insert_id $this->db->insert_id();

 
         $this->db->trans_complete();

 
         return $insert_id;
 
     }

 
     function addPropertyImgs($propertyImgs)
 
     {
 
         $this->db->trans_start();
 
         $this->db->insert('tbl_property_images'$propertyImgs);

 
         $insert_id $this->db->insert_id();

 
         $this->db->trans_complete();

 
         //return $insert_id;

 
     
Reply


Messages In This Thread
RE: $_FILES Array getting empty when using $this->form_validation->run() - by sarath_unrelax - 06-12-2019, 02:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB