下午好,问题是脚本不打印列id_appalto
,而是正确打印列nr_lotto
。
数据库中列的名称是正确的......
...
$conn = new PDO ("mysql:host=$hostname;dbname=$dbname", $user, $pass);
if (!$conn){
die("Could not open connection to database server");
}
result= $conn->prepare("SELECT * FROM Bandi2");
$result->execute();
while($row = $result->fetch(PDO::FETCH_ASSOC)){
echo $row['id_appalto'];
echo ";";
echo $row['nr_lotto'];
echo ";";
}
...
编辑1: Bandi2表的DDL
CREATE TABLE `Bandi2` (
`id_appalto` text,
`nr_lotto` text,
`codice_fiscale_stazione_appaltante` text,
`denominazione_stazione_appaltante` text,
`data_pubb_bando_scp` text,
`tipo_bando` text,
`tipo_settore` text,
`infr_strategica` text,
`oggetto` text,
`tipo_intervento` text,
`rup` text,
`luogo_esecuzione` text,
`cup` text,
`cig` text,
`importo` text,
`cpv` text,
`categoria` text,
`classe` text,
`imp_lavori` text,
`tipo_procedura` text,
`asta_elettronica` text,
`forcella` text,
`appalto_riservato` text,
`data_pubb_guue` text,
`data_pubb_guri` text,
`data_pubb_albo` text,
`url_profilo_comm` text,
`num_quotidiani_naz` text,
`num_quotidiani_loc` text,
`proc_accelerata` text,
`preinformazione` text,
`termine_ridotto` text,
`termine_pres_dom_off` text,
`num_gio_term_esec` text,
`fp_dir_prelaz` text,
`fp_modif_prog_prel` text,
`fp_accett_mod_prog_prel` text,
`fp_obbl_cost_soc_prog` text,
`fp_durata_conces` text,
`fp_note` text,
`url` text
) ENGINE=MyISAM DEFAULT CHARSET=latin1