Guest User

Untitled

a guest
Aug 16th, 2016
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2. //Join-->table
  3. $connection = mysqli_connect("localhost","root","","pets");
  4. // $select="select * from owner inner join pets on owner.owner_id=pets.owner_id";
  5. // $run=mysqli_query($connection,$select);
  6. // $fetch=mysqli_fetch_assoc($run);
  7. // echo "1.". $fetch['owner_name']." has a ".$fetch['Pet_type'];
  8. // $selct="table";
  9. // $select2="table2";
  10. // $run1=...($selct);
  11. // $run2=...($select2);
  12. $id=@$_GET['id'];
  13.  
  14. $select = "select * from pets where pets_id='".$id."'";
  15. $run=mysqli_query($connection,$select);
  16.  
  17. if(mysqli_num_rows($run)==1){
  18. $fetch=mysqli_fetch_assoc($run);
  19. echo $fetch['Pet_type'];
  20. }else{
  21. echo "Sorry The pet type you are looking for does not exist";
  22. }//
  23. Login/Password
  24.  
  25. $username="admin";
  26. $password=md5("password");
  27.  
  28. $select = "select * from table_name where fiedl1=$username and field2=$password";
  29. $run=mysqli_query($connection,$select);
  30. if(mysqli_num_rows($run)==1){
  31. echo "Password and username matches";
  32. }else{
  33. echo "Sorry wrong username or password!Please try again!";
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40. // AJAX,
  41. // OOPS,
  42. // Project,
  43. // Framework
  44. // CI,
  45. // Laravel.
  46. ?>
Add Comment
Please, Sign In to add comment