Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Join-->table
- $connection = mysqli_connect("localhost","root","","pets");
- // $select="select * from owner inner join pets on owner.owner_id=pets.owner_id";
- // $run=mysqli_query($connection,$select);
- // $fetch=mysqli_fetch_assoc($run);
- // echo "1.". $fetch['owner_name']." has a ".$fetch['Pet_type'];
- // $selct="table";
- // $select2="table2";
- // $run1=...($selct);
- // $run2=...($select2);
- $id=@$_GET['id'];
- $select = "select * from pets where pets_id='".$id."'";
- $run=mysqli_query($connection,$select);
- if(mysqli_num_rows($run)==1){
- $fetch=mysqli_fetch_assoc($run);
- echo $fetch['Pet_type'];
- }else{
- echo "Sorry The pet type you are looking for does not exist";
- }//
- Login/Password
- $username="admin";
- $password=md5("password");
- $select = "select * from table_name where fiedl1=$username and field2=$password";
- $run=mysqli_query($connection,$select);
- if(mysqli_num_rows($run)==1){
- echo "Password and username matches";
- }else{
- echo "Sorry wrong username or password!Please try again!";
- }
- // AJAX,
- // OOPS,
- // Project,
- // Framework
- // CI,
- // Laravel.
- ?>
Add Comment
Please, Sign In to add comment