require_once('./deta/ini.php'); try{//投票情報が見れる $dbh = new pdo($dns,$user,$pw); $sql = "SELECT A.`id`,`general_name`,`kk`,`宣伝文`,`m_name` FROM `p_basic_data_2015`AS A LEFT JOIN `p_mogiten_2015_deta` AS B ON A.id=B.id WHERE general_name IS NOT NULL ORDER BY `A`.`id`"; $stmt= $dbh->prepare($sql); $flag=$stmt->execute(array(null)); while($result=$stmt->fetch(PDO::FETCH_ASSOC)){ $mogiten_deta .= "
" .$result['general_name'] . "「" . $result['m_name'] ."」
"; $mogiten_deta .= "団体番号: ".$result['id'] ."
"; $mogiten_deta .= "区画: ".$result['kk']."
"; $mogiten_deta .="".$result['宣伝文']."
"; $mogiten_deta .="