на скорую руку это будет как то так
<?// DBdefine('DB_HOSTNAME', 'localhost');define('DB_USERNAME', 'root');define('DB_PASSWORD', 'qaziop');define('DB_DATABASE', 'test');define('DB_PREFIX', '');$db = mysql_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD);mysql_select_db(DB_DATABASE ,$db);$query = "SELECT DISTINCT *, pd.name AS name, p.image, m.name AS manufacturer, wcd.unit AS weight_class FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN " . DB_PREFIX . "weight_class_description wcd ON (p.weight_class_id = wcd.weight_class_id) WHERE p.date_available <= NOW() AND p.status = '1'";$products = getArray(query($query, $db));echo '<table width="100%">'; for ($j = 0; $j < sizeof($products); $j++) { echo' <tr> <td colspan="2" align="left" style="padding: 30px 5px 0 5px;"><a style="text-decoration: none; color: #006; font-size: 16px; font-weight: bold;" href="'. $products[$j]['href'] .'">'. $products[$j]['name'] .'</a></td> </tr> <tr> <td width="30%"> [img=image/] </td> <td width="70%"> [color= #000; font-size: 13px; font-weight: bold;]Производитель: [/color]<a href="'. $products[$j]['manufacturer_link'] .'" style="text-decoration: none;">'. $products[$j]['manufacturer'] .'</a> [color= #000; font-size: 13px; font-weight: bold;]Модель: [/color]'. $products[$j]['model'] .' [color= #000; font-size: 13px;]'. $products[$j]['shortdescription'] .'...[/color] [color= #000; font-size: 13px;]<a href="'. $products[$j]['href'] .'" style="text-decoration: none;">[ Подробнее ... ]</a[/color] </td> </tr> <tr> <td> [color= #900; font-weight: bold;]'. $products[$j]['price'] .'[/color] </td> </tr> '; } echo '</table>';mysql_close($db); function query($sql, $db) { $resource = mysql_query($sql, $db); if ($resource) { if (is_resource($resource)) { $i = 0; $data = array(); while ($result = mysql_fetch_assoc($resource)) { $data[$i] = $result; $i++; } mysql_free_result($resource); return $data; } else { return TRUE; } } else { exit('Error!'); } } function getArray ($results) { $products = array(); foreach ($results as $result) { if ($result['image']) { $image = $result['image']; } else { $image = 'no_image.jpg'; } $price = $result['price']; $products[] = array( 'name' => $result['name'], 'model' => $result['model'], 'shortdescription' => mb_substr(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'), 0, 250), 'manufacturer' => $result['manufacturer'], 'manufacturer_link' => 'index.php?route=product/manufacturer&manufacturer_id=' . $result['manufacturer_id'], 'thumb' => $image, 'price' => $price, 'href' => 'index.php?route=product/product&product_id=' . $result['product_id'] ); } return $products; } ?>