Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2.  
  3. $host="localhost";
  4.  
  5. $username="u583511941_vb";
  6.  
  7. $password="eclipse2016";
  8. $db_name="u583511941_reser";
  9.  
  10. $con=@mysql_connect($host, $username, $password)or die("cannot connect");
  11.  
  12. mysql_select_db($db_name)or die("cannot select DB");
  13.  
  14. $sql = "SELECT `titulo_img`,`descripcion_img`,`imagen` FROM `images`";
  15.  
  16. $result = mysql_query($sql,$con);
  17. $json = array();
  18.  
  19. if(mysql_num_rows($result)){
  20. while($row=mysql_fetch_object($result)){
  21. $json[]=$row;
  22. }
  23. }
  24. mysql_close($con);
  25. echo json_encode($json);
  26.  
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement