include("/home/ez-bright/inc/option.inc");
include("/home/ez-bright/inc/function.inc");
if(!$backno){$backno=0;}
$printno=10;
$backno_prev=$backno-1;
$backno_next=$backno+1;
$offset=$printno*$backno+3;
$endnewsid_offset=$offset+$printno;
$conn = pg_connect ("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass");
pg_set_client_encoding("SJIS");
$sql = "select * from news_table where news_date<='now' and news_lang=1 and news_type=1 order by news_date desc ,news_id desc offset $offset limit $printno;";
$result = pg_Exec ($conn, $sql);
if(!$result){echo("エラー");exit;}
$sql_sub = "select * from news_table where news_date<='now' and news_lang=1 and news_type=1 order by news_date desc ,news_id desc offset $endnewsid_offset limit 1;";
$result_sub = pg_Exec ($conn, $sql_sub);
if(!$result_sub){echo("エラー");exit;}
$dbdata_sub = pg_fetch_array ($result_sub);
$backno_endnewsid=$dbdata_sub["news_id"];
if($backno_endnewsid){
$sql_sub = "select count(*) from news_table where news_date<='now' and news_lang=1 and news_type=1 and news_id<$backno_endnewsid;";
$result_sub = pg_Exec ($conn, $sql_sub);
$dbdata_sub = pg_fetch_array ($result_sub);
$backno_nextcheck=$dbdata_sub["count"];
}
else{$backno_nextcheck=0;}
?>
蓄光顔料・イージーブライト株式会社・新着情報