Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //2. Perform query
- // Hard coded to test
- $first = "John";
- $last = "Doe";
- $username = "johndoe";
- $password = "wordpass";
- $query = "INSERT INTO table_name (first, last, username, password)
- VALUES ('{$first}', '{$last}', '{$username}', '{$password}')";
- //Most of the time these come from a form with post method
- $result = mysqli_query($connection, $query);
- if($result){
- echo "success";
- } else {
- die("failed");
- }
- ?>
- <!DOCTYPE html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement