Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "password";
- $conn = new PDO("mysql:host=$servername;dbname=Akalpa", $username, $password); // connection to my sql database
- if(isset($_POST['Log In'])){
- $username=$_POST['username'];
- $query = "Insert into User(username) values('$username')"; //query to insert to db
- if (mysql_query($query)) //checking the query
- {
- echo"<h3>Inserted Successfully</h3>"; //value inserted to db successfully
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement