Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = $_POST['username'];
- $password = $_POST['password'];
- $email = $_POST['email'];
- @ $db = new mysqli('localhost','testdb','bob123456','testdb_');
- if (mysqli_connect_errno()) {
- echo 'Error: Could not connect to the database. Please try again later.';
- exit;
- }
- $query = "INSERT INTO users VALUES ('".$username."','".$password."','".$email."')";
- $result = $db->query($query);
- if($result) {
- echo $db->affected_rows." users entered ";
- } else {
- echo "An error occurred<br />";
- }
- $db->close();
- echo $username . " : " . $password . " : " . " : " . $email;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement