Bonjour moogli
Ca fonctionne comme ceci, mais j'ai des problèmes lorsque j'envoie une information avec des guillemets comme "ceci" at pas du tout lorsqu'ils son comme cela « qui ne sont pas ceux-ci » et j'ai les mêmes problèmes avec les mises à jour.
- <?php
- $sql = $dbh->exec('UPDATE matable SET date="'.$date.'", nom="'.$_POST['nom'].'", dep="'.$_POST['dep'].'", infos="'.$_POST['infos'].'" ouvert="0", WHERE id="'.$_POST['id'].'"');
- ?>
Avec ce code, aucun problème si j'envoie des infos avec des guillemets comme "ceci"
- <?php
- $sql = 'INSERT INTO matable (ouvert, nom, dep, infos) VALUES (:ouvert, :nom, :dep, :infos)';
- $stmt = $dbh->prepare($sql);
- $stmt->bindParam(':ouvert', $_POST['ouvert']);
- $stmt->bindParam(':nom', $_POST['nom']);
- $stmt->bindParam(':dep', $_POST['dep']);
- $stmt->bindParam(':infos', $_POST['infos']);
- $stmt->execute();
- ?>
Donc, je me dis, que si ça fonctionne bien avec ce code INSERT, le même code UPDATE devait aussi bien fonctionner avec des guillemets comme "ceci".
- <?php
- $stmt = $dbh->prepare('UPDATE matable SET (ouvert, nom, dep, infos) VALUES (:ouvert, :nom, :dep, :infos) WHERE id = :id');
- $stmt->bindParam(':id', $id);
- $stmt->bindParam(':ouvert', $ouvert);
- $stmt->bindParam(':nom', $nom);
- $stmt->bindParam(':infos', $infos);
- $stmt->execute();
- ?>
Jack
Bonjour LA GLOBULE
Voilà comme est réalisé mon DEFINE
- <?php
- /* ------------------------------------------ */
- define('PATH_HTTP', 'http:www.monsite-net');
- define('PATH_INCLUDE', 'C:/www/www.monsite-net');
- /* ------------------------------------------ */
- ?>
Y a t'il une autre façon de faire ?
Pour le moment j'ai ajouté cette ligne à mon PHP.INI
include_path = "c:\php-5\pear"
Ca a l'air de fonctionner maintenant.
Jack