Intente hacer mysql_fetch_array() pero la consulta y el for consumen demasiado para solamente dos registros.
Que podria hacer en este caso en el cual quiero obtener todos los datos y sacarlos en el loop sin que me consuma casi toda la memoria.
Script:
Código PHP:
Ver original
$dbconnection = mysql_connect($dbhost, $dbuser, $dbpass) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db($dbname, $dbconnection); $query_sliders = "SELECT * FROM ".$dbprefix.$dbsprt."sliders"; $sliders = mysql_query($query_sliders, $dbconnection) or die(mysql_error()); $row_sliders = mysql_fetch_array($sliders); $totalRows_sliders = mysql_num_rows($sliders); mysql_select_db($dbname, $dbconnection); $query_slidersloop = "SELECT COUNT(*) 'id' FROM ".$dbprefix.$dbsprt."sliders"; $slidersloop = mysql_query($query_slidersloop, $dbconnection) or die(mysql_error()); $row_slidersloop = mysql_fetch_array($slidersloop); $totalRows_slidersloop = $row_slidersloop['id']; $com_sliderdata_id = utf8_encode($row_sliders['id']); $com_sliderdata_alias = utf8_encode($row_sliders['alias']); $com_sliderdata_title = utf8_encode($row_sliders['title']); $com_sliderdata_body = utf8_encode($row_sliders['body']); $com_sliderdata_image = utf8_encode($row_sliders['image']); $com_sliderdata_type = utf8_encode($row_sliders['type']); $com_sliderdata_language = utf8_encode($row_sliders['language']); <ul class="ei-slider-large"> <?php for ($i=0; $i < $totalRows_slidersloop; $i++) { ?> <li class="<?php echo $com_sliderdata_alias; ?> slide align- image-content-type"> <?php echo $com_sliderdata_image; ?> <div class="ei-title"> <h2><?php echo $com_sliderdata_title; ?></h2> <h3><?php echo $com_sliderdata_body; ?></h3> </div> </li> <?php } ?> </ul>