Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="localhost";
- $username="u583511941_vb";
- $password="eclipse2016";
- $db_name="u583511941_reser";
- $con=@mysql_connect($host, $username, $password)or die("cannot connect");
- mysql_select_db($db_name)or die("cannot select DB");
- $sql = "SELECT `titulo_img`,`descripcion_img`,`imagen` FROM `images`";
- $result = mysql_query($sql,$con);
- $json = array();
- if(mysql_num_rows($result)){
- while($row=mysql_fetch_object($result)){
- $json[]=$row;
- }
- }
- mysql_close($con);
- echo json_encode($json);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement