简体   繁体   中英

Codeigniter Insert with Select for insert_batch

Is it possible to use insert_batch with a select with codeigniter? For example I need to insert a batch of these:

INSERT INTO a (a_id, b_id, c_id)
    SELECT {$a}, {$b}, c.id
    FROM elci c
    WHERE c.name = {$cName}

Or should I just build the query string manually and execute as regular query?

您可以使用$this->db->query()$this->db->simple_query()来执行此操作, insert_batch()仅用于以其他方式生成的输入。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM