|
No |
日付 |
タイトル |
|
$include_path="/usr/home/kobato-hoikuen/php-lib";
require("$include_path/dbconnect.pl");
class myDbConnect extends DbConnect {
var $dbname = "kobato"; // データベース名
}
$d = new MyDbConnect;
// 文中で自動リンクするかどうか(yes=1 no=0)
$autolink = 1;
/* お知らせ */
$sql="select *,oid from recipe order by date desc\n";
$result = pg_exec($sql);
if ($result == false) {
print"SQL:\"$sql\"の実行に失敗しました。\n";
exit;
}elseif(pg_numrows($result) == 0){
print"バックナンバーはありません。\n";
exit;
}else{
$rows = pg_numrows($result);
$u=0;
for ($i=0 ; $i < $rows ; $i++ ){
$oid = pg_result($result,$i,oid);
$date = pg_result($result,$i,date);
$title = pg_result($result,$i,title);
$title = mb_convert_encoding($title,"SHIFT_JIS","EUC_JP");
list ($year,$month, $day) = split ('-', $date);
$t_year = date ("Y",mktime(0,0,0,$month,$day,$year));
$t_month = date ("n",mktime(0,0,0,$month,$day,$year));
$t_day = date ("j",mktime(0,0,0,$month,$day,$year));
$wday = date ("w",mktime(0,0,0,$month,$day,$year));
#$comment = pg_result ($result,0,comment);
#$comment = str_replace("\n", " \n", $comment); //Win系は\r\n
#$comment = mb_convert_encoding($comment,SJIS,EUC_JP);
$u=$u+1;
echo '
'.$u.' |
'.$t_year.'年'.$t_month.'月 |
'.$title.' |
|
';
}
}
?>
|
|
|
|
|
|