How to solve the active record $ this-> db-> insert () to get an INSERT IGNORE INTO statement?

How to solve the active record $this->db->insert() to execute the INSERT IGNORE INTO ?

I searched Google for a long time but did not find a solution

+4
source share
1 answer

This is my working script! try it

 $inserting_data=array('user_id'=>$user_id, 'user_name'=>$user_name, 'id'=>$product_id, 'cost'=>$click_cost, 'price'=>$current_winner_amount, 'auction_price'=>$new_value, 'date'=>$this->general->get_local_time('time'), 'type'=>'A'); $insert_query = $this->db->insert_string('mytbl', $inserting_data); $insert_query = str_replace('INSERT INTO', 'INSERT IGNORE INTO', $insert_query); $this->db->query($insert_query); 
+2
source

Source: https://habr.com/ru/post/1484136/


All Articles