php sql doubt
i have tried making server the following code is able to do the display work on browser but unable to connect with database in sql. it is online at gillu.pagekite.me/index.php <html> <head> <title> php + sql </title> </head> <body> <a href="php.php">PHP</a> <p> <a href = "/pages/php.php">folder php</a> <form action="/data.php" method="get"> First Name : <input type="text" name="firstname"> <br> Last Name : <input type="text" name="lastname"> <br> <input type="submit" value="Submit"> </form> Welcome <?php echo $_GET["firstname"]; ?><br> Your surname is: <?php echo $_GET["lastname"]; ?> <?php $servername = "localhost"; $username = "root"; $password = "g123"; // Create connection $conn = mysqli_connect($servername, $username, $password, "firstDB"); if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } else echo 'Hello'; $sql = "INSERT INTO tablll(fname , sname) VALUES('".$_GET["firstname"]."' , 'Dubey')"; if (mysqli_query($conn, $sql)) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } ?> </body> </html>