Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $hostname = 'localhost';
- $username = 'chromana_test';
- $password = 'pie';
- try {
- $dbh = new PDO("mysql:host=$hostname;dbname=chromana_main", $username, $password);
- /*** echo a message saying we have connected ***/
- echo 'Connected to database';
- $dbh->exec("INSERT INTO users(UserID, Name) VALUES ('1', '".$_POST["name"]."' )");
- $dbh = null;
- }
- catch(PDOException $e)
- {
- echo $e->getMessage();
- }
- ?>
Add Comment
Please, Sign In to add comment