Here is the code:
while($row = mysql_fetch_array($result)) { $sum_total=$rowNumber * $rowDivide; $image = "media/catalog/product/"; $objDrawing = new PHPExcel_Worksheet_Drawing(); $objDrawing->setName('My Image'); $objDrawing->setDescription('The Image that I am inserting'); $objDrawing->setPath("media/catalog/product/a/d/adidas-v10140-erkek-parka-v10140_8860_1.jpg"); $objDrawing->setCoordinates('A'.$sum_total); $objDrawing->setWorksheet($objPHPExcel->getActiveSheet()); $objPHPExcel->getActiveSheet()->setCellValue('D'.$sum_total,$row['sku']); $objPHPExcel->getActiveSheet()->setCellValue('E'.$sum_total,$row['name']); $objPHPExcel->getActiveSheet()->setCellValue('F'.$sum_total, $row['price']); $objPHPExcel->getActiveSheet()->setCellValue('G'.$sum_total, $row['msrp']); $objPHPExcel->getActiveSheet()->setCellValue('H'.$sum_total, $row['small_image']); $rowNumber++; }
Okay so the problem that is happening, more specifically with this
$objDrawing->setPath("media/catalog/product/a/d/adidas-v10140-erkek-parka-v10140_8860_1.jpg");When, I use this line, every loop just simply shows this image absolutely works fine.
But when I change the code to this:
$objDrawing->setPath("media/catalog/product/".$row['small_image']);I receieve an error, it looks like it wont grab each image link.
Fatal error: Uncaught exception 'Exception' with message 'File media/catalog/productno_selection not found!'
Could anyone please suggest some advice?
Adam