如何在 CodeIgniter 中使用 SQL insert into select。
模型...
public function history($book_id)
{
$query = $this->db->query('INSERT orders (book_id, title)
SELECT book_id, book_title
FROM books
WHERE book_id = \'$book_id\'');
return true;
}
相关分类