Brendan Abolivier vor 9 Jahren
Ursprung
Commit
19e761dbaa
3 geänderte Dateien mit 40 neuen und 0 gelöschten Zeilen
  1. 35
    0
      java/class.connector.php
  2. 0
    0
      java/class.questset.php
  3. 5
    0
      java/index.php

+ 35
- 0
java/class.connector.php Datei anzeigen

@@ -0,0 +1,35 @@
1
+<?php 
2
+
3
+class Connector() {
4
+
5
+	private $bdd;
6
+	
7
+	function __construct() {
8
+		$host = "localhost";
9
+		$db = "burgerquizz";
10
+		$user = "alain";
11
+		$pass = "chabat";
12
+
13
+		$this->bdd = new PDO("mysql:host=$host;dbname=$db", $user, $pass);
14
+	}
15
+
16
+	/*
17
+		Exemple de $options :
18
+
19
+		$options = array(
20
+			"where" => array(
21
+				array("foo", "=", "bar"),
22
+				array("blbl", ">", 5)
23
+			);
24
+			"order by" => array(0, 10, "desc");
25
+		);
26
+	*/
27
+	function Select($fields, $table, $options) {
28
+		$request = "SELECT $fields FROM $table ";
29
+		$arrayVerif = array();
30
+		foreach($options as $name=>$value) {
31
+/*			$request += " $name :$name";
32
+			$arrayVerif[":$name"] = $value;*/
33
+		}
34
+	}
35
+}

+ 0
- 0
java/class.questset.php Datei anzeigen


+ 5
- 0
java/index.php Datei anzeigen

@@ -0,0 +1,5 @@
1
+<?php
2
+	header("Content-Type:application/json");
3
+
4
+	echo json_encode(array("Message" => "Hello world;"));
5
+