PHP - Consulta sobre PHP

 
Vista:

Consulta sobre PHP

Publicado por rosepsycho (1 intervención) el 21/09/2009 13:46:57
Hola,

Os pongo este pedazo de código por si me podéis echar un cable. Está hecho para que salgan los últimos 4 productos que se han introducido en la web pero yo quiero que salgan los cuatro que yo le diga. (131,132,133,134). Me he quedado atascado y necesito vuestra ayuda para poder solucionarlo, a ver si se os ocurre algo.
Os agradezco la ayuda de antemano,
Un saludo

<?php
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' AND p.products_id in (131,132,135,134) order by p.products_date_added desc limit 6");
} else {
$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' AND p.products_id in (131,132,135,134) order by p.products_date_added desc limit 6");
}

$row = 0;
$col = 0;
$info_box_contents = array();
while ($new_products = tep_db_fetch_array($new_products_query)) {
$new_products['products_name'] = tep_get_products_name($new_products['products_id']);

$sql = 'SELECT `products_description` FROM `products_description` WHERE products_id in (131,132,135,134) && language_id='.(int)$languages_id;
$description_query = tep_db_query($sql);
$description = mysql_fetch_array($description_query, MYSQL_ASSOC);
$description['products_description'] = substr($description['products_description'], 0, 65);
$desc_len = strlen($description['products_description']);
$description['products_description'][$desc_len-1] = '.';
$description['products_description'][$desc_len-2] = '.';
$description['products_description'][$desc_len-3] = '.';

if ( ($col == 1 && $row == 0) || ($col == 1 && $row == 2) ){
$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'width="1" height="100%" valign="middle"',
'text' => '<table height="" width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td><div style="width:1px"></div></td>
</tr>
</table>');
}
elseif (($col == 0 && $row == 2) || ($col == 2 && $row == 2)) {
$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'height="1"',
'text' => '<table width="90%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td style="border-top:1px solid #A7A9AC; font-size:1px;"> </td>
</tr>
</table>');
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder