|
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)
)
HTML CODE
<BODY> <form method="GET" action= "Detail.php"> <p>Admission: <br> <input type="text" name="Admission"></p> <P>Name: <br> <input type="text" name="Name"> </P><br> <b>Section:</b> <br> Science <input type="radio" name="section" value="Science"> Commerce <input type="radio" name="section" value="Commerce"> Art <input type="radio" name="section" value="Art"> <br> <br> Medium: <select Name= "Medium"> <option value="English"> English </option> <option value="Sinhala"> Sinhala </option> </select> <br><br> <P><b>Travelling Method:</b> <BR> Bus <input type="checkbox" name="Bus" value="Bus"> Personal Vehicle <input type="checkbox" name="Personal" value="Personal Vehicle"> School Van <input type="checkbox" name="Svan" value="School Van"> <br><br> Describe your ambition: <br> <textarea name="ambition" rows="5" cols="30"> </textarea> <br><br> <input type="submit" name="submit" value="OK"> <input type="reset" name=" reset" value="Reset" </form> </BODY>
PHP CODE
<?PHP $servername = "localhost"; $username = "root"; $password = ""; $dbname = "School"; if(isset($_GET['submit'])) { $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } else { $Admission = $_GET['Admission']; $Name= $_GET['Name']; $Section=$_GET['Section']; $Medium=$_GET['Medium']; $Travel=$_GET['Bus'].", ".$_GET['Personal'].", ".$_GET['Svan']; $ambition=$_GET['ambition']; $sql ="Insert into Details VALUES ($Admission, '$Name', '$Section', '$Medium', '$Travel', '$ambition')"; if ($conn->query($sql) == TRUE) { echo "submitted successfully!"; } else { echo "Error: ".$conn->error; } } } ?>
|