$row['date'] = date("Y-m-d",$row['date']);//格式化
```
2. 縮圖 ```
$row['img'] = getProdImgPath("prod",$row['sn']);
```
二、函數 getProdImgPath($col\_name,$col\_sn)
```
function getProdImgPath($col_name,$col_sn){
global $db;
#撈資料
$sql = "select `file_name`,`sub_dir`
from `ugm_p_files_center`
where `col_name`='{$col_name}' and `col_sn`='{$col_sn}'
";
$result = $db->query($sql) or redirect_header("", 3000, $db->error."\n".$sql,true);
$row = $result->fetch_assoc();
if($row){
$row['file_name'] = htmlspecialchars($row['file_name'], ENT_QUOTES);
$row['sub_dir'] = htmlspecialchars($row['sub_dir'], ENT_QUOTES);
$ImgPath = WEB_URL."/uploads/".$row['sub_dir']."/".$row['file_name'];
}else{
$ImgPath="";
}
return $ImgPath;
}
```