1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| <?php header('Content-type: application/xml'); ?>
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="personnetest.xsl"?>
<personne>
<?php
$dsn='xxxxxx';
$user= 'xxxxxxx';
$pass='xxxxxxxxxxx';
try{
$conn=new PDO('oci:dbname='.$dsn,$user,$pass);
foreach($conn->query('SELECT * from Personne1') as $row) {
//print_r($row);
?>
<id><?php echo $row['IDPERS']; ?></id>
<nom><?php echo $row['NOMPERS']; ?></nom>
<prenom><?php echo $row['PRENOMPERS']; ?></prenom>
<login><?php echo $row['LOGIN']; ?></login>
<password><?php echo $row['PASSWORD']; ?></password>
<?php
}
$conn = $null;
}catch(PDOException $e) {
echo 'echec de la connexion : ' . $e->getMessage();
}
?>
</personne> |
Partager