执行非查询SQL语句


  1. $sql = 'DELETE FROM topic_channel WHERE channel_id = 100 AND type = 1';
  2. User::connection()->execute($sql);
  3. $sql = 'DELETE FROM topic_channel WHERE channel_id = ? AND type = ?';
  4. User::connection()->execute($sql, [100, 1]);