Guest User

Untitled

a guest
Oct 31st, 2018
722
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "";
  5.  
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password);
  9.  
  10. // Check connection
  11. if ($conn->connect_error) {
  12. die("Connection failed: " . $conn->connect_error);
  13. }
  14.  
  15. $select_db = mysqli_select_db($conn,'akdms_contactdb');
  16. if (!$select_db) {
  17. die("Database Selection Failed" . mysqli_error($connection));
  18. }
  19.  
  20. ?>
  21.  
  22. <?php
  23.  
  24. echo $first_name = "Ankith";
  25. echo $last_name = "Reddy";
  26. echo $company_name = "A K Collectives Private Limited";
  27. echo $postion = "Managing Director";
  28. echo $email = "ankith.reddy2009@gmail.com";
  29. echo $phone_number = "8555867870";
  30. echo $requirement = "Awesome Sauce";
  31.  
  32. if($sql = "INSERT INTO `akdms_contactdb`.`akdms_contactus` (`first_name`, `last_name`, `company_name`, `position`, `email`, `phone_number`, `requirement`) VALUES ('Ankith', 'Reddy', 'AK Collectives Private Limited', 'Managing Director', 'ankith.reddy@gmail.com', '8555867870', '100 Tones of Awesome Sauce');")
  33. { echo "Inserted Successfully";
  34. } else {
  35. echo "Insertion Failed";
  36. };
  37. ?>
Add Comment
Please, Sign In to add comment