Welcome Guest, Not a member yet? Register   Sign In
How to insert corporate details into database
#7

(This post was last modified: 11-18-2020, 12:14 PM by christaliise.)

(11-18-2020, 07:48 AM)InsiteFX Wrote: My fault, in your model you gave it an alias name which had a lower case first letter try this now.

PHP Code:
$this->load->model('Afghanistancorporate_model''afghanistancorporate_model');

$corporatename $this->input->post('corporatename');
$password $this->input->post('password');
$countryterritory $this->session->userdata('country_territory'); 

$this->afghanistancorporate_model->insert_corporate($corporatename$password$countryterritory); 

Yes, that fixed it. But I cant see where I used lower case first letter. The rules are that models must have upper case first letter.

Now I know how to insert into a database, I should be able to resolve my other problem of uploading photos & fwrite data for an advert. If I upload the photos first & insert $product into a temp field of a database table then redirect (that Im still working on) to the data upload and recover the $product name by;

PHP Code:
$product $this->session->userdata('temp_1'); 

But then I will need to delete the contents of that field probably best when it redirects to the finished advert.

Do you know how to delete the contents?

Im jumping the gun here a little coz I should be searching before I ask questions. I hope you dont mind.

UPDATE

I think I can answer my question as follows. Just correct me if they are wrong.

These go into a model;

PHP Code:
public function insert_product($product)
    {
    
$data = array('temp_1'=> $product);
    
$this->db->insert('tbl_members'$data);
    }

public function 
delete_product($product)
    {
    
$data = array('temp_1'=> $product);
    
$this->db->delete('tbl_members'$data);
    } 

And these go into the appropriate Controllers;

PHP Code:
$this->members_model->insert_product($product);
$this->members_model->delete_product($product); 
Reply


Messages In This Thread
RE: How to insert corporate details into database - by christaliise - 11-18-2020, 09:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB