Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = 'localhost';
- $user = 'root';
- $pass = '';
- $db = 'mcgas';
- $charset = 'utf8';
- //pdo connection
- //odb object database
- $odb = new PDO("mysql:host=" . $host . ";dbname" . $db, $user, $pass);
- // set the PDO error mode to exception
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- if (isset($_POST['username'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $email = $_POST['email'];
- $q = "INSERT INTO users(user_name, user_passwod, user_email) VALUES(':username', ':password', ':email');";
- $query = $odb->prepare($q);
- $results = $query->execute(array(
- ":username" => $username,
- ":password" => $password,
- ":email" => $email
- ));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement