how to output to the template, records in the loop, at the moment only one line is output to the template, although the cycle displays 4 lines
$sql="SELECT mu.fullname, mp.name as namep, mp.price as pricep FROM modx_shopkeeper3_orders mo left JOIN modx_shopkeeper3_purchases mp on mp.order_id=mo.id left join modx_user_attributes mu on mu.id=mo.userid where mo.id=36"; $result = mysql_query($sql); $document = $PHPWord->loadTemplate('chek.docx'); //шаблон $document->setValue('user', 'Иванов'); // while ($parent = mysql_fetch_assoc($result)) { $document->setValue('blyudo', $parent['namep'].'.....'.$parent['pricep']); //фамилияотчество } $document->setValue('city', 'Минск'); //фамилияотчество $document->save('Template_full.docx'); //имя заполненного шаблона для сохранения } } template
Обед ${fio} ${name} ${price} Приятного аппетита!!! ${adress}
while ($parent = mysql_fetch_assoc($result))not a loop? Give an example of input and output (which you want). - E_p