Postingan lainnya
PHP Fatal error: Call to a member function num_rows() on boolean in
Maaf ka mau tanya kalo error seperti ini itu masalahnya di mana ya? Terimakasih
PHP Fatal error: Call to a member function num_rows() on boolean in /home/public_html/penjualan/application/models/M_barang.php on line 26
unknown.png
0
Tanggapan
Kode kamu sulit dibaca, coba taro di tag kode dan dirapikan agar bisa dibantu
1 Jawaban:
<pre> $data['totalData'] = $this->db->query($sql)->num_rows();
if( ! empty($like_value))
{
$sql .= " AND ( ";
$sql .= "
a.`kode_barang` LIKE '%".$this-&gt;db-&gt;escape_like_str($like_value)."%'
OR a.`nama_barang` LIKE '%".$this-&gt;db-&gt;escape_like_str($like_value)."%'
OR a.`size` LIKE '%".$this-&gt;db-&gt;escape_like_str($like_value)."%'
OR IF(a.`total_stok` = 0, 'Kosong', a.`total_stok`) LIKE '%".$this-&gt;db-&gt;escape_like_str($like_value)."%'
OR CONCAT('Rp. ', REPLACE(FORMAT(a.`harga`, 0),',','.') ) LIKE '%".$this-&gt;db-&gt;escape_like_str($like_value)."%'
OR a.`keterangan` LIKE '%".$this-&gt;db-&gt;escape_like_str($like_value)."%'
OR b.`kategori` LIKE '%".$this-&gt;db-&gt;escape_like_str($like_value)."%'
OR c.`merk` LIKE '%".$this-&gt;db-&gt;escape_like_str($like_value)."%'
";
$sql .= " ) ";
}</pre>
0