title: Call to undefined method CodeIgniter\Database\MySQLi\Builder::num_rows()
body: <p>Im trying to make a code generator for my table</p>
  <p><strong>Here's my model :</strong></p>
  <pre><code>public function buat_kode()   {
  
      $this-&gt;db-&gt;table('RIGHT(proses_cutting.kode_packing_list,6) as kode', FALSE);
      $this-&gt;builder()-&gt;orderBy('kode_packing_list','DESC');    
      $this-&gt;builder()-&gt;limit(1);    
        $query = $this-&gt;db-&gt;table('proses_cutting');      //cek dulu apakah ada sudah ada kode di tabel.    
        if ($query-&gt;num_rows() &lt;&gt; 0){      
         //jika kode ternyata sudah ada.      
          $data = $query-&gt;row();      
          $kode = intval($data-&gt;kode) + 1;    
        }
        else {      
         //jika kode belum ada      
          $kode = 1;    
        }
  
        $kodemax = str_pad($kode, 6, &quot;0&quot;, STR_PAD_LEFT); // angka 4 menunjukkan jumlah digit angka 0
        $kodejadi = &quot;PLIK059&quot;.$kodemax;    // hasilnya ODJ-9921-0001 dst.
        return $kodejadi;
      }
  </code></pre>
  <p><strong>controller :</strong></p>
  <pre><code>public function create()
  {
      session();
      $data = [
          'main' =&gt; 'prosescutting/create',
          'validation' =&gt; \Config\Services::validation(),
          'title' =&gt; 'Form Tambah Proses Cutting',
          'kodeunik' =&gt; $this-&gt;pcuttingModel-&gt;buat_kode(),
          'kode_packing_list' =&gt; $kodePackingSekarang,
      ];
      return view('template/template', $data);
  }
  </code></pre>
  <p><strong>and my table :</strong>
  <a href="https://i.stack.imgur.com/JEXyk.png" rel="nofollow noreferrer">Table</a></p>
  <p>What im trying to do is make a generator for  kode_packing_list for each item of nama_barang so when i input another Renata Blouse it will automatically fill with <strong>PLIK059000007</strong></p>
  <p>But when I tried to run it, it show me these errors:</p>
  <blockquote>
  <p>Error
  Call to undefined method CodeIgniter\Database\MySQLi\Builder::num_rows()
  APPPATH\Models\PcuttingModel.php at line 33</p>
  </blockquote>
  <p>and the line 33 is</p>
  <pre><code>if ($query-&gt;num_rows() &lt;&gt; 0){  
  </code></pre>