cl_HostName = trim(fgets($fp)); $this->cl_UserID = trim(fgets($fp)); $this->cl_Password = trim(fgets($fp)); $this->cl_DbName = trim(fgets($fp)); } fclose($fp); } // echo "$this->cl_HostName
"; // echo "$this->cl_UserID
"; // echo "$this->cl_Password
"; // echo "$this->cl_DbName
"; //接続 $this->cl_Conn = mysql_connect($this->cl_HostName, $this->cl_UserID, $this->cl_Password); if(!$this->cl_Conn){ die("DB connect error."); } //データベース選択 if(!mysql_select_db($this->cl_DbName, $this->cl_Conn)){ die("DB select error."); } } //クエリ処理 function sql_query($sql_str){ $this->cl_Rows = mysql_query($sql_str, $this->cl_Conn); if(!$this->cl_Rows){ die("DB error
{$sql_str}
" .mysql_errno().": ".mysql_errno()); } return $this->cl_Rows; } //DATA FETCH function sql_fetch(){ return mysql_fetch_array($this->cl_Rows); } } ?>