include("/home/ez-bright/inc/option.inc"); include("/home/ez-bright/inc/function.inc"); $conn = pg_connect ("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass"); pg_set_client_encoding("SJIS"); $sql = "select count(*) from news_table where news_date<='now' and news_lang=1 and news_type=2 and news_id>=$newsid;"; $result = pg_Exec ($conn, $sql); $dbdata = pg_fetch_array ($result); $newscount=$dbdata["count"]; $sql = "select * from news_table where news_date<='now' and news_lang=1 and news_type=2 and news_id=$newsid limit 1;"; $result = pg_Exec ($conn, $sql); if(!$result){echo("エラー");exit;} $dbdata = pg_fetch_array ($result); $newsid=$dbdata["news_id"]; $date=$dbdata["news_date"]; $title=$dbdata["news_title"]; $msg=$dbdata["news_msg"]; $title1=$dbdata["title1"]; $title2=$dbdata["title2"]; $date1=substr($date,2,2).".".substr($date,5,2).".".substr($date,8,2); ?>