Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addCustomer($fname, $lname, $address, $phone) {
- $db = new MyDB();
- if(!$db){
- echo '<script type="text/javascript">alert("'.$db->lastErrorMsg().'");</script>';
- } else {
- //echo "Opened database successfullyn";
- }
- $sql ='INSERT INTO CUSTOMERS (FIRSTNAME, LASTNAME, ADDRESS, PHONE) VALUES ("'.$fname.'", "'.$lname.'", "'.$address.'", "'.$phone.'");';
- $db->query($sql);
- }
- <?php
- require_once "queryDb.php";
- $firstname = $_POST["firstname"];
- $lastname = $_POST["lastname"];
- $address = $_POST["address"];
- $phone = $_POST["phone"];
- ?>
- <form action="reviewsubmit.php" method="post">
- Test Address
- <input type="text" id="address" name="address" placeholder="test"> />
- Test phone
- <input type="text" id="phone" name="phone" placeholder="test"> />
- <input type="submit" name="Submit" value="Submit" />
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement