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

(11-18-2020, 12:30 PM)InsiteFX Wrote: You used and alias when you initiated your model.

PHP Code:
---------------------> Model -----------------------> Model Alias Name.
$this->load->model('Afghanistancorporate_model''afghanistancorporate_model'); 

You only need the first one the alias is if you want to use a different name for your model.

Yes that is the correct way of doing it.

On your model calls you can assigning a result from the insert and delete.
All the model methods and QueryBuilder return a result from the methods.

Im almost at the my destination. But cant get the $product to enter temp_1

The first line of this coding is in the Controller and other lines in the Model;

PHP Code:
    $this->username_model->update_product($product);

public function 
update_product($product)
    {
    
$this->db->where('user_name'$lcuser);
    
$data = array('temp_1'=> $product);
    
$this->db->update('tbl_members'$data);
    } 

If I use "insert" it creates a new line & I dont want that. Im assuming I wont need delete coz a new entry should replace the old.

What can be wrong with the above?
Reply


Messages In This Thread
RE: How to insert corporate details into database - by christaliise - 11-20-2020, 03:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB