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
| try{
//connexion base test
$bdd = new PDO('mysql:host=localhost;dbname=application_v2', 'root', '');
$sql='insert into ofs(cd_ofs,date_envoi,receptionniste,chauffeur,commentaire,phase,aog,rouge)values("'.$of.'","'.$date_envoi.'","'.$receptionniste.'","'.$chauffeur.'","'.$commentaire.'","'.$phase.'","'.$aog.'","'.$rouge.'")';
//connexion base helios pour lecture
$bdd_helios = new PDO("oci:dbname=".$HELIOSII, $utilisateur , $utilisateur );
$bdd_helios->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
if($bdd_helios){
echo "<br>connexion bdd ok ! <br>";
echo('<br> l of est : '.$of.'<br>');
}
//ici ça ne marche pas et quans je remplace of_saisi par le chiffre saisi ça marche!
$result=$bdd_helios->prepare('select * from Helios.OFS where ID_OFS = :of_saisi');
$result->execute(array(
'of_saisi' =>$_POST['OF']
));
//PARCOURS RESULTAT+TEST
$row = $result->fetchAll(PDO::FETCH_ASSOC);
foreach($row as $cle =>$valeur){
if (is_array($valeur)) {
//test
echo 'QTE est : '.$valeur['QTE_LANCEE'];
}
}
$nb_ligne=$result->rowCount();
}
catch (PDOException $erreur){
echo $erreur->getMessage();
} |
Partager