Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $enlace = mysql_connect('localhost', 'mineco_prod', 'Appneco2014');
- if (!$enlace)
- {
- die('No se pudo conectar : ' . mysql_error());
- }
- $bd_seleccionada = mysql_select_db('mineco_produccion', $enlace);
- if (!$bd_seleccionada)
- {
- die ('No se puede usar mineco_produccion : ' . mysql_error());
- }
- mysql_query ("SET NAMES 'utf8'");
- $sql="SELECT * from banners order by orden DESC";
- $result = mysql_query($sql) or die('query did not go through');
- while ($rowEmp = mysql_fetch_assoc($result))
- {
- $banner = null;
- $banner['url_link'] = $rowEmp['url_link'];
- $banner['imagen'] = "http://minecochea.com.ar/imagenes/auspicios/".$rowEmp['imagen'];
- $banner['id_comercio'] = $rowEmp['id_comercio'];
- $banner['id_categoria'] = $rowEmp['id_categoria'];
- $banner['link'] = $rowEmp['link'];
- $data[] = $banner;
- }
- echo json_encode($data,true);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement