Kenapa saya mendapatkan eror "the query you submitted is not valid"?

Function SAW

function saw(){

		// collect skill
		$skill = array();
		$sk = $_POST["skill"];
		foreach ($sk as $sek) {
			array_push($skill, "'".$sek."'");
		}
		$skills = implode(",",$skill);

		// collect nilai
		$nilai = $this->input->post("nilai");

		//collect gaji
		$gaji = $this->input->post("gaji");

		// collect Lokasi
		$lokasi = ($this->input->post("lokasi") == "0" ? false : true);

		// collect jurusan
		$jurusan = $this->input->post("jurusan");

		$sql = $this->model_data->getRating($skills, $nilai, $gaji, $lokasi, $jurusan);

		$result = $this->db->query("$sql")->result();

		$saw = new Algoritma();
		// menambahkan Kriteria
		$saw->addCriteria("skill",$this->input->post("bobot_skill")/100,"1");
		$saw->addCriteria("nilai",$this->input->post("bobot_nilai")/100,"0");
		$saw->addCriteria("gaji",$this->input->post("bobot_gaji")/100,"0");
		$saw->addCriteria("lokasi",$this->input->post("bobot_lokasi")/100,"1");
		$saw->addCriteria("jurusan",$this->input->post("bobot_jurusan")/100,"1");


		foreach ($result as $hasil) {
			$alt = new Alternative("$hasil->kode_lowongan","$hasil->nama_perusahaan");
			$alt->addCriteria("skill",$hasil->skill);
			$alt->addCriteria("nilai",$hasil->nilai);
			$alt->addCriteria("gaji",$hasil->gaji);
			$alt->addCriteria("lokasi",$hasil->lokasi);
			$alt->addCriteria("jurusan",$hasil->jurusan);

			$saw->addAlternative($alt);
		}
		$saw->generate();
		$rekomendasi = $saw->data;
		for ($i=0; $i < count($rekomendasi); $i++) {
			for ($j=($i+1); $j < count($rekomendasi); $j++) {
				if($rekomendasi[$i]->preferensi < $rekomendasi[$j]->preferensi){
					$temp = $rekomendasi[$i];
					$rekomendasi[$i] = $rekomendasi[$j];
					$rekomendasi[$j] = $temp;
				}
			}
		}
		$data["hasil"] = $rekomendasi;
		$this->load->view("home/sawhasil",$data);
	}

Query di Model data

function getRating($skill, $nilai, $gaji, $lokasi, $jurusan ){
    $parameter = array(
      "skills" => $skill,
      "nilai" => $nilai,
      "gaji" => $gaji,
      "lokasi" => $lokasi,
      "jurusan" => $jurusan,
    );

		$p='';
		for($i=0;$i<count($parameter);$i++){
			if($p=='') $p='?';
			else $p.=',?';
		}
		$proc="call rating($p)";
		$query=$this->db->query($proc,$parameter);
		$sqltext = $query->row()->sqltext;
		// $query->free_result();
		mysqli_next_result( $this->db->conn_id );

		return $sqltext;
  }

avatar nandaseptania
@nandaseptania

1 Kontribusi 0 Poin

Dipost 5 tahun yang lalu

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban