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_type1 = "select *,substring(news_title,1,20) as title1,substring(news_title,21,20) as title2 from news_table where news_date<='now' and news_lang=1 and news_type=1 order by news_date desc ,news_id desc limit 3;"; $result_type1 = pg_Exec ($conn, $sql_type1); if(!$result_type1){echo("�G���[");exit;} $sql_type2 = "select *,substring(news_title,1,20) as title1,substring(news_title,21,20) as title2 from news_table where news_date<='now' and news_lang=1 and news_type=2 order by news_date desc,news_id desc limit 3;"; $result_type2 = pg_Exec ($conn, $sql_type2); if(!$result_type2){echo("�G���[");exit;} ?>