$query = $db->query("SELECT * FROM tb_siswa order by id_siswa asc", PDO::FETCH_ASSOC);
$result = $db->query("select * from tb_siswa");
↓
$query = $db->prepare("SELECT * FROM tb_siswa order by id_siswa asc", PDO::FETCH_ASSOC);
$result = $db->prepare("select * from tb_siswa");