function get_description($table, $id){
global $conn;
if ($id!='') {
$sql = "SELECT * FROM ".$table." WHERE id=".$id;
$result = mysqli_query($conn, $sql);
if (!$result) {
die("Connection failed: " . mysqli_error($conn));
}
if (mysqli_num_rows($result) < 1) {
}else{
$rows = mysqli_fetch_assoc($result);
$description = $rows['description'];
}
return $description;
}else{
return "";
}
}
我在我的functions.php中有這個函數。我試圖下載一個CSV文件,它下載CSV文件,但給出了CSV文件的返回函數 - 未定義通知錯誤 - 下載csv文件
公告標題中的通知:
未定義的變量:描述 /VAR /www/html/include/functions.php on line 73
73行是指 - return $ description;
我想擺脫csv文件的通知錯誤。
謝謝,功效神奇:) – CNk