Selamat pagi...Mas saya mau tanya cara penanganan erro pada php.
Saya lagi belajar save edit delete data di database. waktu belajar edit data terjadi kesalahan di fung si mysql_fetch_array(), saya sudah mengulang menulis code tapi masih salah juga, tanda warning ny seperti ini.
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\phpmysql\form_edit_data_pemuda.php on line 25.
dan code edit data nya seperti ini.
<?php
//connecting to database
$host = 'localhost';
$user = 'root';
$password = '';
$name_db = 'pemuda';
$connect = mysql_connect($host, $user, $password) or die ('connecting database fail');
mysql_select_db($name_db, $connect) or die ('selecting database not match');
//Membuat variabel
$No = $_REQUEST['No'];
//Menampilkan data
$sql = "SELECT * FROM pemudacephin WHERE ".$No = $_REQUEST['No'];
$data = mysql_query($sql);
$row = mysql_fetch_array($data);
$No = $row['No'];
$Nama = $row['Nama'];
$No_rumah = $row['No_rumah'];
$TTL = $row['TTL'];
$No_hp = $row['No_hp'];
$Kesibukan = $row['Kesibukan'];
$Kelamin = $row['Kelamin'];
if($Kelamin == 'Laki-laki'){
$pa = 'checked';
$pi = '';
}else{
$pa = '';
$pi = 'checked';
}
?>
mohon bantuannya