Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getConnection()
- {
- $bdd=new PDO('mysql:host:localhost;dbname=test;"root",""');
- return $bdd;
- }
- function getAllArticles()
- {
- $rq="select * from Article";
- $resultat=getConnection()->query($rq);
- return $resultat;
- }
- function getArticle($articleCode)
- {
- $rq="select * from Article where idArticle= " . $articleCode . " ";
- $resultat=$resultat=getConnection()->exec($rq);
- return $resultat;
- }
- function getComments()
- {
- $rq="select * from Commentaire";
- $resultat=getConnection()->query($rq);
- return $resultat;
- }
- function insertComment($comm)
- {
- $rq="insert into Commentaire values ( " . $comm["idCommentaire"] . " , " . $comm["idArticle"] . " , '" . $comm["commentaireContenu"] . "' , '" . $comm["dateheure"] . "' , '" . $comm["pseudo"] . "' ) " ;
- getConnection()->exec($rq);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement