Postingan lainnya
Saya mau tanya supaya data dari database bisa muncul di halaman mpdf bagaimana ya?
Permasalahan : Warning : mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\table\rep.php on line 15 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\table\rep.php on line 18
Script nya :
14. $jum=mysql_query("SELECT COUNT(*) as jml FROM smc WHERE data_user ='" . $_GET['data_user'] . "' AND tgl_masuk BETWEEN '" . $_GET['tgl_masuk'] . "' AND '" . $_GET['tgl_keluar'] . "' AND alamat = '" . $_GET['alamat'] . "'"); 15. $count = mysql_fetch_array($jum); 16. $a = mysql_query("SELECT * FROM data_user WHERE dtr_pa ='" . $_GET['dtr_pa'] . "' AND tgl_terima BETWEEN '" . $_GET['tgl_awal'] . "' AND '" . $_GET['tgl_akhir'] . "' AND golongan = '" . $_GET['jns_periksa'] . "' order by tgl_terima asc"); 17 $doc = mysql_query("SELECT * FROM smc WHERE id_pasien ='" . $_GET['id_pasien'] . "'"); 18. $nm_doc = mysql_fetch_array($doc);
1 Jawaban:
arti errornya fungsi mysql_fetch_array membutuhkan "resource'< yang diamsukkan di paramter ini pada kode kamu adalah "boolean"
coba didebug lagi pelan pelan aplikasinya dirunut satu satu variablenya, hasilnya sudah sesuai yang kamu mau atau belum
<a href='https://sekolahkoding.com/forum/cara-menampilkan-error-debug-di-php-1552899672'>cara debug php</a>