Advertisement
Guest User

Untitled

a guest
Aug 9th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2.  
  3. $db_name="webapp";
  4. $mysql_username="root";
  5. $mysql_password="";
  6. $server_name="localhost";
  7. $con=mysqli_connect($server_name,$mysql_username,$mysql_password,$db_name);
  8.  
  9. if(!$con)
  10. {
  11. echo"Connection Error .......".mysqli_connect_error();
  12. }
  13. else
  14. {
  15. echo"<h3>Database connection Success ..... </h3>";
  16. }
  17.  
  18.  
  19. ?>
  20.  
  21. <?php
  22.  
  23. require"init.php";
  24. $user_name="YASER";
  25. $user_phone="123456";
  26.  
  27. $sql_query="select name from user_info where user_name like'$user_name'and
  28. user_phone like'$user_phone';";
  29.  
  30. $result=mysqli_query($con,$sql_query);
  31. if(mysqli_num_rows($result)>0)
  32. {
  33. $row=mysqli_fetch_assoc($result);
  34. $name=$row["name"];
  35. echo"<h3> Hello And Wellcome".$name."</h3>";
  36. }
  37. else
  38. {
  39. echo" No Info Is Available .......";
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement