private function GetDbBody2($column_no) { $body = array(); try { // SQL組み立て ---------------------------------------------- $param = array(); $sql = "SELECT"; $sql .= " column_body_no,"; $sql .= " sub_title,"; $sql .= " column_body "; $sql .= "FROM"; $sql .= " t_column_body "; $sql .= "WHERE"; $sql .= " column_no = ?"; $sql .= "ORDER BY"; $sql .= " seq "; $sql .= " LIMIT 1;"; $param[] = $column_no; $reader = $this->dbCon->ExecuteReader($sql, $param); $row = $reader->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT); if ($row) { $column_body_no = $row["column_body_no"]; $body["column_body_no"] = $column_body_no; $body["sub_title"] = $row["sub_title"]; $body["column_body"] = strip_tags($row["column_body"], ""); // 画像 $body["img_nm"] = fimgGetFileName($column_body_no, "column/tn_"); if (strlen($body["img_nm"]) > 0) { $body["img_show"] = true; } else { $body["img_show"] = false; } $body["img_src"] = fimgImgSrc($body["img_nm"], "column/tn_"); } } catch (PDOException $e) { cmnLogOutput("db error : " . print_r($e, true)); } return $body; }
private function GetDbBody() { $body_list = array(); try { // SQL組み立て ---------------------------------------------- $param = array(); $sql = "SELECT"; $sql .= " column_body_no,"; $sql .= " sub_title,"; $sql .= " column_body "; $sql .= "FROM"; $sql .= " t_column_body "; $sql .= "WHERE"; $sql .= " column_no = ?"; $sql .= "ORDER BY"; $sql .= " seq "; $param[] = $this->column_no; $reader = $this->dbCon->ExecuteReader($sql, $param); while ($row = $reader->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) { unset($item); $column_body_no = $row["column_body_no"]; $item["column_body_no"] = $column_body_no; $item["sub_title"] = $row["sub_title"]; $item["column_body"] = $row["column_body"]; // 画像 $item["img_nm"] = fimgGetFileName("pc_" . $column_body_no, "column/"); if (strlen($item["img_nm"]) > 0) { $item["img_show"] = true; } else { $item["img_show"] = false; } $item["img_src"] = fimgImgSrc($item["img_nm"], "column/"); $body_list[] = $item; } } catch (PDOException $e) { cmnLogOutput("db error : " . print_r($e, true)); } return $body_list; }