浏览代码

Bye index testing, hello palmares application of the Connector class

父节点
当前提交
160d60ef00
共有 2 个文件被更改,包括 22 次插入14 次删除
  1. 2
    14
      web/index.php
  2. 20
    0
      web/palmares.php

+ 2
- 14
web/index.php 查看文件

@@ -2,19 +2,7 @@
2 2
 
3 3
 require_once('classes.php');
4 4
 
5
-//	header("Content-Type:application/json");
5
+header("Content-Type:application/json");
6 6
 
7
-//	echo json_encode(array("Message" => "Hello world;"));
7
+echo json_encode(array("Message" => "Hello world;"));
8 8
 
9
-
10
-$bdd = new Connector();
11
-
12
-$options = array(
13
-	"where" => array(
14
-		array("login", "=", "Dragavnir"),
15
-	),
16
-	"order by" => array("score", "desc"),
17
-	"limit" => array(0, 10) // Ou array(10)
18
-);
19
-
20
-var_dump($bdd->Select("*", "scores", $options));

+ 20
- 0
web/palmares.php 查看文件

@@ -0,0 +1,20 @@
1
+<?php
2
+
3
+require_once('classes.php');
4
+
5
+$bdd = new Connector();
6
+
7
+$options = array(
8
+	"order by" => array("score", "desc"),
9
+	"limit" => array(0, 10) // Ou array(10)
10
+);
11
+
12
+$res = $bdd->Select("*", "scores", $options);
13
+
14
+echo("<ol>");
15
+
16
+foreach($res as $row) {
17
+	echo(utf8_encode("<li>".$row["login"]." (".$row["score"].")</li>"));
18
+}
19
+
20
+echo("</ol>");