/** @var Server $server */
$server = $em->getRepository('MyBundle:Server')->findOneById($id);
while ($row = mysqli_fetch_array($result)) {
echo '<option>'.$row[0].'</option>';
}
$row = mysqli_fetch_array($result);
$cnt = count($row);
for ($i=0; $i < $cnt; $i++) {
echo '<option>'.$row[$i].'</option>';
}
select p.*, p_g.*, p_i.*
from `product` p
left join `product_group` p_g ON p_g.id = p.group_id
left join `product_image` p_i ON p_i.product_id = p.id
ORDER BY p_i.`product_id` ASC
LIMIT 0, 200