diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-03-17 22:15:58 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-03-17 22:15:58 +0100 |
commit | bd20965314da58dd81a19ed20e9b539b7045257a (patch) | |
tree | 4fb453918810e24037fe58c097f10c7d36d3d9fb /public/index.php | |
parent | a8d40a4ac2f73da9509bde6c8337c13042cc6992 (diff) | |
download | wcms-bd20965314da58dd81a19ed20e9b539b7045257a.tar.gz wcms-bd20965314da58dd81a19ed20e9b539b7045257a.zip |
class stables
Diffstat (limited to 'public/index.php')
-rw-r--r-- | public/index.php | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/public/index.php b/public/index.php index 90df7d7..9b8a61b 100644 --- a/public/index.php +++ b/public/index.php @@ -4,22 +4,48 @@ <?php -var_dump(__FILE__); +try +{ + $bdd = new PDO('mysql:host=localhost;dbname=wcms;charset=utf8', 'root', ''); +} +catch(Exception $e) +{ + die('Erreur : '.$e->getMessage()); +} -$htdocs = str_replace(basename(__FILE__), __FILE__, ''); +// $reponse = $bdd->query('SELECT nom, age FROM art2 WHERE nom = \'eddie\''); -var_dump($htdocs); +// while ($donnees = $reponse->fetch()) +// { +// echo $donnees['nom'] . ' a ' . $donnees['age'] . ' ANS<br />'; +// } -var_dump($_SERVER["DOCUMENT_ROOT"]); +// $reponse->closeCursor(); +// $req = $bdd->prepare('SELECT nom, age FROM art2 WHERE age = 23 '); +// $req->execute(array($_GET['possesseur'], $_GET['prix_max'])); -set_include_path('e:/WEB/wcms'); +// echo '<ul>'; +// while ($donnees = $req->fetch()) +// { +// echo '<li>' . $donnees['nom'] . ' (' . $donnees['prix'] . ' EUR)</li>'; +// } +// echo '</ul>'; -echo get_include_path(); +// $req->closeCursor(); +$req = $bdd->prepare('SELECT * FROM art WHERE id = :id '); +$req->execute(array('id' => 'articlet')); +echo '<ul>'; +while ($donnees = $req->fetch()) +{ + echo '<li>' . $donnees['titre'] . ' (' . $donnees['id'] . ' ANS)</li>'; +} +echo '</ul>'; + +$req->closeCursor(); -include('fn/fn.php'); ?>
\ No newline at end of file |