diff --git a/createdb.sql b/createdb.sql new file mode 100644 index 0000000..c446c05 --- /dev/null +++ b/createdb.sql @@ -0,0 +1,4 @@ +CREATE DATABASE gestion_depenses; +CREATE USER 'gestdep'@'localhost' IDENTIFIED BY 'password'; +GRANT ALL PRIVILEGES ON gestion_depenses.* to 'gestdep'@'localhost'; +FLUSH PRIVILEGES; \ No newline at end of file diff --git a/gestion_depenses.sql b/gestion_depenses.sql new file mode 100644 index 0000000..2fd99c4 --- /dev/null +++ b/gestion_depenses.sql @@ -0,0 +1,80 @@ +-- phpMyAdmin SQL Dump +-- version 4.6.6deb4 +-- https://www.phpmyadmin.net/ +-- +-- Client : localhost:3306 +-- Généré le : Jeu 20 Décembre 2018 à 21:30 +-- Version du serveur : 10.1.37-MariaDB-0+deb9u1 +-- Version de PHP : 7.0.33-0+deb9u1 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Base de données : `gestion_depenses` +-- + +-- -------------------------------------------------------- + +-- +-- Structure de la table `gest_cat` +-- + +CREATE TABLE `gest_cat` ( + `cat_date` datetime NOT NULL, + `cat_id` varchar(10) NOT NULL, + `cat_name` varchar(40) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `gest_cpt` +-- + +CREATE TABLE `gest_cpt` ( + `cpt_date` int(11) NOT NULL, + `cpt_id` int(10) NOT NULL, + `cpt_name` int(40) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `gest_datas` +-- + +CREATE TABLE `gest_datas` ( + `datas_dates_crea` datetime NOT NULL, + `datas_dates_op` date NOT NULL, + `datas_types` varchar(6) NOT NULL, + `datas_montants` int(11) NOT NULL, + `datas_mdp` varchar(10) NOT NULL, + `datas_cat` varchar(10) NOT NULL, + `datas_commentaires` text NOT NULL, + `datas_files` blob NOT NULL, + `datas_tags` varchar(10) NOT NULL, + `datas_comptes` varchar(10) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `gest_mdp` +-- + +CREATE TABLE `gest_mdp` ( + `mdp_date` datetime NOT NULL, + `mdp_id` varchar(10) NOT NULL, + `mdp_name` varchar(40) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/traitement.php b/traitement.php new file mode 100644 index 0000000..0a7c4b4 --- /dev/null +++ b/traitement.php @@ -0,0 +1,15 @@ +getMessage()); +} + +// On ajoute une entrée dans la table jeux_video +$bdd->exec('INSERT INTO gest_datas(datas_cat, datas_commentaires, datas_comptes, datas_dates_crea, datas_dates_op, datas_mdp, datas_montants, datas_tags, datas_types) VALUES(\'1234567890\', \'Achat d un paquet de clope\', \'5555500000\', 20181220214000, 20181220, \'0987654321\', \'7.80\', \'#clopes\', \'sorties\' )'); + +echo 'operation ajouté !'; +?> \ No newline at end of file