View difference between Paste ID: zhZiggtN and dQPuatuN
SHOW: | | - or go back to the newest paste.
1
<!DOCTYPE html>
2
<html>
3
<head>
4
	<title></title>
5
</head>
6
<body>
7
8
<?php
9
10
$site = "localhost";
11
$user = "sax";
12
$pass = "asdf1234";
13
$dbname = "preguntas";
14
$tbname = "preguntas";
15
16
$dblink = mysqli_connect($site, $user, $pass, $dbname);
17
18
if (mysqli_connect_errno()){
19
	echo "Fail dood!\n" .  mysqli_connect_error();
20
	exit();
21
}
22
23
24-
$resource = mysqli_query($dblink, "SELECT * FROM $tbname WHERE Tier=0");
24+
25-
$row = mysqli_fetch_all($resource);
25+
26
//ask for something like this $row[14][1];
27
28
//Inicia Quizz
29-
foreach ($row as $key => $value) {
29+
30-
	# code...
30+
31
$cummas = array();
32
/*!
33
34
*/
35
$allas = array();
36
$resources = array();
37
array_push($resources, mysqli_query($dblink, "SELECT * FROM $tbname WHERE Tier=0"));
38
$qs_init = mysqli_fetch_all($resources[0]);
39
40-
//sumar y mostrar resultados
40+
$as = array(1,3,7,3,6,5,9,8,2,5,7, 5, 8, 2, 9);
41
42
43-
?>
43+
44
//Muestra grupo inicial
45
46
47
48
/* debug
49
foreach ($qs_init as $q) {
50
	echo "$q[1]\n";
51
}
52
53
print_r($row);
54
 */
55
56
//Multiply por Ponderación
57
58
for ($i=0; $i < sizeof($as); $i++) { 
59
	$temp = array();
60
	array_push($temp, $qs_init[$i][1]);
61
	array_push($temp, $as[$i] * $qs_init[$i][2]);
62
	array_push($temp, $as[$i] * $qs_init[$i][3]);
63
	array_push($temp, $as[$i] * $qs_init[$i][4]);
64
65
	array_push($allas, $temp);
66
	}
67
68
//calcular y mostrar porcentaje de preguntas
69
//pedir siguiente tier
70
71
//mostrar siguiente tier
72
73
//muestra tier nuevo
74
75
//sumar y mostrar resultados0
76
77
//graph
78
79
for ($i=0; $i < 15 ; $i++) { 
80
	echo $allas[$i][0], "<br><br>";
81
}
82
?>
83
84
</body>
85
</html>