Commit a5d7d11c93a5e81d4ee67090e857ca279350088a
1 parent
62a4b843
[Orga] Script d'import retiré
Showing
2 changed files
with
0 additions
and
116 deletions
Show diff stats
events.sql deleted
... | ... | @@ -1,69 +0,0 @@ |
1 | --- phpMyAdmin SQL Dump | |
2 | --- version 4.2.7.1 | |
3 | --- http://www.phpmyadmin.net | |
4 | --- | |
5 | --- Client : localhost | |
6 | --- Généré le : Mar 11 Novembre 2014 à 22:27 | |
7 | --- Version du serveur : 5.6.20 | |
8 | --- Version de PHP : 5.5.15 | |
9 | - | |
10 | -SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | |
11 | -SET time_zone = "+00:00"; | |
12 | - | |
13 | - | |
14 | -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
15 | -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
16 | -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
17 | -/*!40101 SET NAMES utf8 */; | |
18 | - | |
19 | --- | |
20 | --- Base de données : `crep` | |
21 | --- | |
22 | - | |
23 | --- -------------------------------------------------------- | |
24 | - | |
25 | --- | |
26 | --- Structure de la table `events` | |
27 | --- | |
28 | - | |
29 | -CREATE TABLE IF NOT EXISTS `events` ( | |
30 | -`id` smallint(5) unsigned NOT NULL, | |
31 | - `creationTime` int(10) unsigned NOT NULL, | |
32 | - `nom` text CHARACTER SET utf8 NOT NULL, | |
33 | - `description` mediumtext CHARACTER SET utf8 NOT NULL, | |
34 | - `annule` tinyint(1) NOT NULL DEFAULT '0', | |
35 | - `valide` int(10) unsigned NOT NULL DEFAULT '0', | |
36 | - `duree` mediumint(8) unsigned NOT NULL DEFAULT '3600', | |
37 | - `supprime` tinyint(1) NOT NULL DEFAULT '0' | |
38 | -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; | |
39 | - | |
40 | --- | |
41 | --- Contenu de la table `events` | |
42 | --- | |
43 | - | |
44 | -INSERT INTO `events` (`id`, `creationTime`, `nom`, `description`, `annule`, `valide`, `duree`, `supprime`) VALUES | |
45 | -(1, 1415737327, 'Événement de test n°1', 'Description de l''événement de test n°1.', 0, 0, 7200, 0), | |
46 | -(2, 1415738888, 'Événement de test n°2', 'Description de l''événement de test n°2.\r\nNouvelle ligne et caractères $ρ∑⊂|⋀∪×.', 1, 0, 12345, 0); | |
47 | - | |
48 | --- | |
49 | --- Index pour les tables exportées | |
50 | --- | |
51 | - | |
52 | --- | |
53 | --- Index pour la table `events` | |
54 | --- | |
55 | -ALTER TABLE `events` | |
56 | - ADD PRIMARY KEY (`id`), ADD KEY `id` (`id`); | |
57 | - | |
58 | --- | |
59 | --- AUTO_INCREMENT pour les tables exportées | |
60 | --- | |
61 | - | |
62 | --- | |
63 | --- AUTO_INCREMENT pour la table `events` | |
64 | --- | |
65 | -ALTER TABLE `events` | |
66 | -MODIFY `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3; | |
67 | -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | |
68 | -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | |
69 | -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
import.php deleted
... | ... | @@ -1,47 +0,0 @@ |
1 | -<?php | |
2 | - | |
3 | -// Script d'import de table SQL | |
4 | -// TEMPORAIRE | |
5 | -// de http://stackoverflow.com/questions/19751354/how-to-import-sql-file-in-mysql-database-using-php | |
6 | - | |
7 | -require('creds.php'); | |
8 | - | |
9 | -if (isset($_GET['KAMGF6QfHGl8GHypRCat'])) { | |
10 | - | |
11 | - // Name of the file | |
12 | - $filename = 'events.sql'; | |
13 | - | |
14 | - // Connect to MySQL server | |
15 | - mysql_connect(__MYSQL_HOSTNAME__, __MYSQL_USERNAME__, __MYSQL_PASSWORD__) or die('Error connecting to MySQL server: ' . mysql_error()); | |
16 | - | |
17 | - // Select database | |
18 | - mysql_select_db(__MYSQL_DATABASE__) or die('Error selecting MySQL database: ' . mysql_error()); | |
19 | - | |
20 | - // Temporary variable, used to store current query | |
21 | - $templine = ''; | |
22 | - | |
23 | - // Read in entire file | |
24 | - $lines = file($filename); | |
25 | - | |
26 | - // Loop through each line | |
27 | - foreach ($lines as $line) { | |
28 | - | |
29 | - // Skip it if it's a comment | |
30 | - if (substr($line, 0, 2) == '--' || $line == '') continue; | |
31 | - | |
32 | - // Add this line to the current segment | |
33 | - $templine.= $line; | |
34 | - | |
35 | - // If it has a semicolon at the end, it's the end of the query | |
36 | - if (substr(trim($line), -1, 1) == ';') { | |
37 | - | |
38 | - // Perform the query | |
39 | - mysql_query($templine) or print ('Error performing query \'<strong>' . $templine . '\': ' . mysql_error() . '<br /><br />'); | |
40 | - | |
41 | - // Reset temp variable to empty | |
42 | - $templine = ''; | |
43 | - } | |
44 | - } | |
45 | - echo "Tables imported successfully"; | |
46 | -} | |
47 | -?> | |
48 | 0 | \ No newline at end of file |