Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2. $db_name="probnik";
  3. $mysql_user="root";
  4. $mysql_pass="";
  5. $server_name="localhost";
  6.  
  7.  
  8. $con=mysqli_connect($server_name,$mysql_user,$mysql_pass,$db_name);
  9.  
  10.  
  11.  
  12. $Name=$_POST['Query'];
  13. $sql="SELECT * FROM exam WHERE Name LIKE '%$Name'";
  14.  
  15. $query=mysqli_query($con,$sql);
  16. if($query){
  17. while($row=mysqli_fetch_array($query))
  18. {
  19. $data[]=$row;
  20. }
  21. print(json_encode($data));
  22. }else{
  23. echo('Not Found');
  24. }
  25. mysqli_close($con);
  26.  
  27.  
  28. ?>
  29.  
  30. mysqli_set_charset($con, 'utf8');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement