El 8 de enero de 2017, 03:26, Alex ( Servtelecom ) <[email protected]> escribió: > he comparado con un info del php y todo esta igual, linea por linea así que > cada vez lo entiendo menos. os plasmo el código php que falla, si quito este > código funciona pero lógicamente falta un trozo de la web jejeje! así que > aquí esta la resolución de parte de mi problema, que modulo o que se me > escapa del php.ini o del vhost para que funcione este código > > code: > > <div class="container"> > <ul class="breadcrumb"> > <li><a > href="./"><?=look_tag_return('tag_breadcrumb_home',$_SESSION['idioma_id'],'breadcrumb');?></a></li> > <li > class="active"><?=look_tag_return('tag_breadcrumb_ofertas',$_SESSION['idioma_id'],'breadcrumb');?></li> > </ul> > > <div class="gap"></div> > <?php > > $hotels = "SELECT h.*,c.n_name as ciudad FROM hoteles h, city c > WHERE h.n_lang = ".$_SESSION['idioma_id']." AND c.n_id = h.n_city AND > h.n_lang = c.n_lang"; > $hotels = mysql_query($hotels); > while(@$row = mysql_fetch_assoc($hotels)){ > $results[] = $row; > } > > foreach($results as $hotel){ > $SqlOfertas = "SELECT o.* FROM ofertashoteles oh, ofertas o > WHERE oh.n_hotel = ".$hotel['n_id']." AND oh.n_oferta = o.n_id AND o.n_lang > = ".$_SESSION['idioma_id']; > $rsOfertas = mysql_query( $SqlOfertas); > $ofertas = []; > > if($_SESSION['idioma'] == 'ru'){ > $idioma_busqueda = "SELECT la_id FROM languages WHERE > la_abbreviation = 'en' LIMIT 1"; > $idioma_busqueda = mysql_query($idioma_busqueda); > $idioma_busqueda = mysql_fetch_object($idioma_busqueda); > > $name_hotel = "SELECT h.*,c.n_name as ciudad FROM > hoteles h, city c WHERE h.n_lang = ".$idioma_busqueda->la_id." AND c.n_id = > h.n_city AND h.n_lang = c.n_lang AND h.n_id = ".$hotel['n_id']; > $name_hotel = mysql_query($name_hotel); > $name_hotel = mysql_fetch_object($name_hotel); > $hotel['n_name'] = $name_hotel->n_name; > $hotel['tag_city'] = $hotel['ciudad']; > $hotel['ciudad'] = $name_hotel->ciudad; > }else{ > $hotel['tag_city'] = $hotel['ciudad']; > } > > while(@$wekk = mysql_fetch_assoc($rsOfertas)){ > $ofertas[] = $wekk; > } > > > $SqlOfertasImg = 'select * from images WHERE img_ruta = > "hoteles_head_image" and img_product = '.$hotel['n_id'].' order by img_order > asc'; > $rsOfertasImg = mysql_query( $SqlOfertasImg); > $oSqlOfertasImg = mysql_fetch_object($rsOfertasImg); > > ?> > <div class="article post row"> > > <header class="col-sm-4" style="text-align:center;"> > <?php > if( !$oSqlOfertasImg ){ > echo '<img src="images/noimage.png" > alt="'.$oSqlOfertas->n_name.'" title="'.$oSqlOfertas->n_name.'">'; > }else{ > echo '<img > src="images/hoteles/'.$oSqlOfertasImg->img_file.'" > alt="'.$oSqlOfertas->n_name.'" title="'.$oSqlOfertas->n_name.'">'; > } > ?> > </header> > > <div class="post-inner col-sm-6" style="margin-left: > 15px; margin-right:15px;"> > <div class="post-title"> > <div class="item-serv col-xs-12"> > <div class="row" style="height: 53px;"> > <div class="desc-bt"> > <div class="hoteles-home-label > hotel-d col-xs-8"> > <span class="letras-hotel" > style="vertical-align: top;text-align: right;display: block;"><h4><?php echo > look_tag_return('tag_hotel_hotel',$_SESSION['idioma_id'],'hotel').' > '.$hotel['n_name']; ?></h4></span> > </div> > <span class="col-xs-4 sc" > style="padding-right: 0; padding-top: 19px; right: 0;"> > <div class="stars > stars<?=$hotel['n_estrellas'];?>"></div> > </span> > </div> > </div> > </div> > </div> > <ul class="post-meta hund"> > </ul> > <?php > $oferta_final = ''; > foreach($ofertas as $oferta){ ?> > <div class="modal fade" > id="article<?=$oferta['n_id'].$hotel['n_id']?>" tabindex="-1" role="dialog" > aria-labelledby="myModalLabel"> > <div class="modal-dialog" role="document"> > <div class="modal-content"> > <div class="modal-header"> > <button type="button" class="close" > data-dismiss="modal" aria-label="Close"><span > aria-hidden="true">×</span></button> > <h4 class="modal-title" > id="myModalLabel"><?php echo > look_tag_return('tag_hotel_hotel',$_SESSION['idioma_id'],'hotel').' > '.$hotel['n_name']; ?></h4> > </div> > <div class="modal-body"> > <?php echo $oferta['n_description']; > ?> > </div> > </div> > </div> > </div> > <ul> > <li><?php echo $oferta['n_name']; ?> <a > class="badge" data-toggle="modal" > data-target="#article<?=$oferta['n_id'].$hotel['n_id']?>">+Info</a></li> > <?php /*<li><?php echo $oferta['n_description']; > ?></li>*/ ?> > </ul> > <? } ?> > <a class="label label-primary" href="<?php echo > $_SESSION['idioma'].'/'.toAscii(look_tag_return('ciudades_url_tag',$_SESSION['idioma_id'],'sections')).'/'.$hotel['n_city'].'/'.toAscii($hotel['ciudad']); > ?>.html"><i class="fa fa-map-marker"></i> > <?=look_tag_return('tag_show_city',$_SESSION['idioma_id'],'0')?></a> > <a class="label label-primary" href="<?php echo > $_SESSION['idioma'].'/'.toAscii(look_tag_return('hotel_url_tag',$_SESSION['idioma_id'],'sections')).'/'.$hotel['n_id'].'/'.toAscii($hotel['n_name']); > ?>.html"><i class="fa fa-building"></i> > <?=look_tag_return('tag_show_hotel',$_SESSION['idioma_id'],'0')?></a> > </div> > </div> > <? > } > ?> > </div> >
Tienes un problema de corregir en tu código, no es que este mal, bueno no lo he revisado, no me interesa por el momento. El problema radica en las funciones de mysql para PHP, al instalar Centos 7 te instala las nuevas versiones de paquetes de PHP y estas están destinadas para soportar nuevas funciones para el tratamiento de consultas SQL y resultados. Estas estan obsoletas http://php.net/manual/es/function.mysql-query.php http://php.net/manual/es/function.mysql-fetch-object.php http://php.net/manual/es/function.mysql-fetch-assoc.php Tus mensajes en tu app no son errores, son Warning PHP Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource PHP Warning: Variable passed to each() is not an array or object Te comento yo tengo un servidor en Centos 6, pero he migrado aun por que el código de una de mis aplicaciones esta programado para PHP 4.0 Espero puedas corregir tu problema, recomendaría una actualización de la APP para PHP. -- Saludos, cheperobert _______________________________________________ CentOS-es mailing list [email protected] https://lists.centos.org/mailman/listinfo/centos-es
