-1
我使用php,mysql從我的數據庫檢索數據,它既不顯示錯誤也不給我所需的數據。我的查詢沒有顯示任何東西
public function last_material_code($department_id){
$query = $this->db->prepare("SELECT material_code FROM materials_tbl WHERE dept_id = $department_id");
return $query -> execute();
}
<?php
include_once ('select.class.php');
if(isset($_POST['department_id'])){
$department_id = $_POST['department_id'];
$object = new select_class($DB_con);
$object -> last_material_code($department_id);
}
?>
公共職能last_material_code($部門標識){$ query = $ this-> db-> prepare(「SELECT material_code FROM materials_tbl WHERE dept_id = $ department_id」); return $ query - > execute(); } –
你在哪裏/如何迴應? –
那是因爲你沒有處理你的查詢生成的結果集。 **閱讀手冊** – RiggsFolly