<?php
mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Ошибка соединения: " . mysql_error());
mysql_select_db("mydb");
$result = mysql_query("SELECT id, name FROM mytable");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf("ID: %s Имя: %s", $row[0], $row[1]);
}
mysql_free_result($result);
?>
id | name
-----------------
1 | category1
2 | category2
3 | category3
id | manufactured_id | name
-----------------
1 | 1 | product1
2 | 2 | product2