This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import ReponseQuiz from './Reponse'; | |
import SubmitTest from './submitTest'; | |
import AnswerIsCorrect from './answerIsCorrect'; | |
import AnswerIsWrong from './answerIsWrong'; | |
import { MDBBtn, MDBCard, MDBCardBody, MDBCardImage, MDBCardTitle, MDBCardText, MDBCol, MDBRow, MDBIcon, MDBAnimation } from 'mdbreact'; | |
class DisplayQuizz extends Component { | |
constructor(props) { | |
super(props); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.delete('/api/movie/:id', (req, res) => { | |
// récupération des données envoyées | |
const idMovie = req.params.id; | |
// connexion à la base de données, et suppression de l'employé | |
connection.query('DELETE FROM movie WHERE id = ?', [idMovie], err => { | |
if (err) { | |
// Si une erreur est survenue, alors on informe l'utilisateur de l'erreur |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const port = 3000; | |
const connection = require('./conf'); | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies | |
app.use(bodyParser.urlencoded({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const port = 3000; | |
const connection = require('./conf'); | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies | |
app.use(bodyParser.urlencoded({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Requete 1 : | |
INSERT INTO movie VALUES (null, "zootopia", "https://lumiere-a.akamaihd.net/v1/images/movie_poster_zootopia_866a1bf2.jpeg?region=0%2C0%2C300%2C450", "Super dessin animé"); | |
Requete 2 : | |
INSERT INTO movie VALUES (null, 'Le Royaume des chats', 'http://fr.web.img6.acsta.net/medias/nmedia/18/35/08/08/affiche.jpg', 'Un super Miyazaki'); | |
Requete 3: | |
INSERT INTO movie (name, poster, comment) VALUES ('Le Chateau ambulant', 'http://fr.web.img6.acsta.net/medias/nmedia/18/35/48/22/18399898.jpg', 'super Miyazaki'), ('Danse avec les loups', 'https://vignette.wikia.nocookie.net/desencyclopedie/images/1/18/Kevin_Costner%2C_jury_d%27honneur.jpg/revision/latest?cb=20120715134118', 'super film'), ('Pirates des Caraibes', 'http://fr.web.img4.acsta.net/medias/nmedia/18/35/07/46/affiche2.jpg', 'super film'); | |
Requete 4: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mysql = require('mysql'); | |
const connection = mysql.createConnection({ | |
host : 'localhost', // adresse du serveur | |
user : 'root', // le nom d'utilisateur | |
password : '*****', // le mot de passe : j'ai enlevé le mot de passe pour des raisons de confidentialité | |
database : 'sqlquests', // le nom de la base de données | |
}); | |
module.exports = connection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const port = 3000; | |
app.get('/', (request, response) => { | |
response.send('Bienvenue par ici !'); | |
}); | |
app.get('/api/movies', (request, response) => { | |
response.send('Bienvenue sur la page movie !'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Requete 1 : | |
DELETE FROM movie | |
WHERE id='5'; | |
Requete 2 : | |
DELETE FROM movie | |
WHERE id >'10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Requete 1: | |
UPDATE movie | |
SET name='Men in Black' | |
WHERE id='5'; | |
Requete 2: | |
UPDATE movie | |
SET name='Deadpool' | |
WHERE id='8'; | |
UPDATE movie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Requête SQL 1 : SELECT * from movie | |
Requête SQL 2 : SELECT name from movie | |
Requête SQL 3 : SELECT id, poster from movie | |
Requête SQL 4: SELECT poster, comment as avis_spectateur from movie |
NewerOlder