-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconecao.php
35 lines (34 loc) · 1.01 KB
/
conecao.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
echo"<center>";
$hostname="localhost";
$username="root";
$password="";
$dbname="imc";
$con = mysqli_connect($hostname,$username,$password,$dbname);
$query = "SELECT * FROM informacao";
$result = mysqli_query($con,$query);
if(mysqli_num_rows($result) > 0 )
echo"<table border=2>";
echo "<tr>";
echo "<th>Id</th>";
echo "<th>Nome</th>";
echo "<th>Nome da escola </th>";
echo "<th>Idade </th>";
echo "<th>Sexo</th>";
echo "<th>Peso</th>";
echo "<th>Altura</th>";
echo "<th>imc</th>";
echo "</tr>";
while($row = mysqli_fetch_array($result)){
echo "<tr>";
echo "<td>" . $row["id"] . "</td>";
echo "<td>" . $row["nome"] . "</td>";
echo "<td>" . $row["nomedaescola"] . "</td>";
echo "<td>" . $row["idade"] . "</td>";
echo "<td>" . $row["genero"] . "</td>";
echo "<td>" . $row["peso"] . "</td>";
echo "<td>" . $row["altura"] . "</td>";
echo "<td>" . $row["imc"] . "</td>";
}
echo "</table>";
?>