query($sql); $allFields=array(); $allFields = $res->fetchAll()[0]; return $allFields; } public function updateTKAkun($id,$tahun,$nilai){ $strSQL1 = "select * from tk_neraca where Id='$id' and tahun='$tahun'"; $resQuery1 = $db->query($strSQL1); if ($resQuery1 && ($resQuery1->numRows() != 0) && (mysqli_error($connect) == "")) { $strSQL2 ="update tk_neraca set nilai='$nilai' where Id='$id' and tahun='$tahun'"; $resQuery2 = $db->query($strSQL2); } else { $strSQL2 ="insert into tk_neraca(id,tahun,nilai) values('$id','$tahun','$nilai')"; $resQuery2 = $db->query($strSQL2); } if ($resQuery2 ) { $this->intRow = mysql_affected_rows(); return true; } else { $this->strDBError = mysqli_error($connect); return false; } } public function db_connect(){ $conn = mysql_connect($this->db_host, $this->db_user, $this->db_pass); if($conn) { mysql_select_db($this->db_database, $conn); } return $conn; } public function db_disconnect(){ mysqli_close(); } } ?>