Corsi ECM
[insert_php]
define( “DB_HOST”, “editreeit.mydb-aruba.it” );
define( “DB_NAME”, “Swp1646987-prod” );
define( “DB_USR”, “Swp1646987” );
define( “DB_PWD”, “4787jd1068” );
define( “DB_HOST”, “editreeit.mydb-aruba.it” );
define( “DB_NAME”, “Swp1646987-prod” );
define( “DB_USR”, “Swp1646987” );
define( “DB_PWD”, “4787jd1068” );
define( “PREFIX”, “A_EDTR_ECM” );
function openDbConn(){
$dbh = new PDO( “mysql:host=” . DB_HOST . “;dbname=” . DB_NAME, DB_USR, DB_PWD );
$dbh->exec( “set names utf8” );
//echo “\nPDO::errorInfo():\n”;
//print_r($dbh->errorInfo());
return $dbh;
}
$dbh=openDbConn();
$sql = “SELECT * FROM `”.PREFIX.”_Corsi` ORDER BY `CRS_data_inizio`”;
$stmt=$dbh->prepare($sql);
$stmt->execute();
$corsi = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo ‘
ID | Ed | Titolo | Data | Sede | Iscritti |
‘.$c[‘CRS_id’].’ | ‘.$c[‘CRS_ed’].’ | ‘.$c[‘CRS_titolo’].’ | ‘.$c[‘CRS_data’].’ | ‘.$c[‘CRS_sede’].’ | ‘.count($iscritti).’ |
‘;
foreach($corsi as $k => $c){
echo ‘
‘;
}
[/insert_php]