blob: b23c8c07ab289845486d082bf9751a372d0aba89 [file] [log] [blame]
Andreu0b2f8432019-09-18 20:09:59 +02001<?php
2 // Define MySQL login variables
Andreued8e1f92019-09-18 22:26:04 +02003 $servername = "localhost"; // "fdb22.awardspace.net";
4 $username = "root"; // "3155560_users";
5 $password = ""; // "btechnoro@fox4news.info";
Andreu0b2f8432019-09-18 20:09:59 +02006
7 // Create connection
Andreued8e1f92019-09-18 22:26:04 +02008 $conn = new mysqli($servername, $username, $password, "pastanaga");
Andreu0b2f8432019-09-18 20:09:59 +02009 if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
10 $conn->set_charset("utf8");
11
12 // Do the query
13 $query = "SELECT * FROM users";
14
15 // Fetch the information of the user
16 if ($result = $conn->query($query)) {
17 while ($row = $result->fetch_row()) {
18 $id = $row[0];
19 $nomcomplet = $row[1];
20 $curs = $row[2];
21 $grau = $row[3];
22 $quimata = $row[4];
23
24 // Echo the options
25 echo "<option value='".$id."'>".$nomcomplet."</option>\n";
26 }
27 $result->close();
28 } else {
29 die("Wrong query: " . $query);
30 }
31
32 // Close connection
33 $conn->close();
34?>