While Loop
adamdemerlis <[email protected]>
| Newsgroups | gmane.comp.web.oscommerce.features |
|---|---|
| Message-ID | <4f49305bd805d213bfe66426188b8231@osCommerce-Forums> |
This message was sent from: Features
http://forums.oscommerce.com/viewtopic.php?p=194952#194952
----------------------------------------------------------------
I just took MAX_RANDOM_SELECT_NEW out from the code in order to get a true random image from the database however I need to create a while loop, something like this -
[code]
$row = 0;
$col = 0;
$info_box_contents = array();
// while () {
$info_box_contents[] = array('align' => 'center',
'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id'], 'NONSSL') . '">' . $random_product['products_name'] . '</a><br>' . $rprod_price
);
// $col ++;
// if ($col > 2) {
// $col = 0;
// $row ++;
// }
// }
new infoBox($info_box_contents);
}
?>
[/code]
Can you help me?