Details Table
Admission | Name | Section | Medium | Transport | Ambition |
---|
30326 | Pasangi | | Sinhala | Bus | To be interior designer | 30325 | Santhushi | | English | Personal Vehicle | To become a general manager
| 30327 | Gayanima | | English | Personal Vehicle | CEO | 30328 | Do Min-joon | Art | Sinhala | Bus | Actor | 30329 | Siripala | Art | English | Personal Vehicle | Actor | 30330 | Kim Jong-un | Science | Sinhala | Bus Personal Vehicle School Van | President
| 30331 | Elon Musk | Science | English | Personal Vehicle | CEO of Tesla Motors
| 30332 | Abittiya | Art | Sinhala | Bus | To be monk | 27004 | Tavini | Science | English | Bus | To be a lawyer
| 90000 | perera | Commerce | English | Bus |
kkmkk | 10023 | Ishani | | English | |
| 30338 | Siripala | Science | English | Bus | Nothin
| 34908 | sawandi | Commerce | English | School Van |
| 52283 | abc | Commerce | English | Bus School Van |
| 209 | 11 | Science | Sinhala | Bus, Personal Vehicle, |
faerqre2 | 58352 | Lee min huu | Commerce | English | , Personal Vehicle, |
actor | 27468 | Ahn Hyo Seop | Art | English | , Personal Vehicle, | Actor,Singer,Model | 12345 | Sirisena | Commerce | Sinhala | Bus, , | ssfsfg
| 70990 | Alice | Art | Sinhala | Bus, Personal Vehicle, School Van | Fashion Designer | 13813 | ABCDEF | Science | English | Bus, , School Van | DFFSDSF | 14515 | XYZ | Science | English | Bus, Personal Vehicle, |
CCCC | 11990 | PQRST | Commerce | English | Bus, Personal Vehicle, School Van | AAAAAAAAAA
| 8383 | hhhh | Commerce | English | , , |
| 19078 | D-1 | Science | English | Bus, , |
aaaa | 28535 | Thisini | Art | English | , Personal Vehicle, |
| 28534 | Heshani himaya | Science | English | , Personal Vehicle, |
| 56789 | abcdefg | Science | Sinhala | Bus, Personal Vehicle, | test test
| 897287 | Cobra | Science | English | Bus, Personal Vehicle, | srtgdhdghse
| 19175 | Kawindya | Science | English | Bus, Personal Vehicle, |
fjzdgfskgfsjhf | 1957 | test-2024 | Commerce | Sinhala | Bus, Personal Vehicle, School Van | afsadgdsfgs
| 29100 | Denawaka Hamine | Science | Sinhala | , , School Van | Actress |
|
SQL CREATE TABLE STATEMENT
CREATE TABLE Details
(
Admission INT,
Name VARCHAR(150),
Section VARCHAR(20),
SubMedium VARCHAR(20),
Transport VARCHAR(25),
Ambition VARCHAR(300),
PRIMARY KEY(Admission)
)
PHP CODE
<?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "School"; $conn = new mysqli($servername, $username, $password, $dbname); $sql = "SELECT * FROM Details"; if($conn == false) { die("ERROR: Could not connect." .connect_error()); } else { if($result = $conn->query($sql)) { if($result->num_rows > 0) { echo "<table border=1>"; echo "<tr>"; echo "<th>Admission</th> <th>Name</th> <th>Section</th> <th>Medium</th> <th>Transport</th> <th>Ambition</th>"; echo "</tr>"; while($row =$result->fetch_assoc()) { echo "<tr>"; echo "<td>" . $row['Admission'] . "</td>"; echo "<td>" . $row['Name'] . "</td>"; echo "<td>" . $row['Section'] . "</td>"; echo "<td>" . $row['SubMedium'] . "</td>"; echo "<td>" . $row['Transport'] . "</td>"; echo "<td>" . $row['Ambition'] . "</td>"; echo "</tr>"; } echo "</table>"; } else { echo "<br>"."No records matching your query were found."; } } else { echo "<br>"."ERROR: Could not able to execute $sql. " . error($conn); } } mysqli_close($conn); ?>
|