Title1

Title2

Title3

MarkDown

<{$row.content}>
<{$token}>
<{/if}> ``` 4. 取得商品某筆資料 ```
  
  ###############################
  # 商品單筆資訊
  ###############################
  function getProd($sn){
    global $db;
    #撈資料
    $sql = "select *
            from `ugm_p_prod`
            where `sn`='{$sn}'
    ";
    $result = $db->query($sql) or redirect_header("", 3000,  $db->error."\n".$sql,true);
    $row = $result->fetch_assoc();  
    return $row;
  }
  ```
5. 用 $col\_name,$col\_sn 取得圖片路徑 ```
  
  
  #用 $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;
  }
  ```
6.