Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2. $a="hello";
  3. $b="india";
  4. $c="1997-12-12";
  5. $d="srinu";
  6. $query="insert into user_info values('$a','$b','$c','$d')";
  7. $db='example';
  8. $user='root';
  9. $pass="";
  10. $conn=mysqli_connect($host,$user,$pass,$db);
  11. if($conn){
  12. echo "Connection Success".'<br>';
  13. }
  14. else{
  15. echo "Error";
  16. }
  17. if($q=mysqli_query($conn,$query)){
  18. echo "Data added to Database".'<br>';
  19. }
  20. else{
  21. echo "Can't add to DB";}
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement