My store creates a pdf automatic download as the product. The pdf includes the customer’s name and products options. Worked great with one product option, but now I have five product options. The pdf is now generating one page per product option. I need all product options together.
Please help; I very new to php.
<?php require_once 'CreateVoucher.class.php'; $order_id = (int)$_GET['order_id']; $exp_date = date("M d Y"); $control_number = 4000 + $order_id; $con = mysql_connect("isl1126608032145.db.8066570.hostedresource.com", "isl1126608032145", "f1lmw0rK-"); mysql_select_db("isl1126608032145", $con); $query = " SELECT O.billing_name as customers_name, OP.products_name, OPA.products_options_values FROM orders O INNER JOIN orders_products AS OP ON OP.orders_id = O.orders_id INNER JOIN orders_products_attributes AS OPA ON OPA.orders_products_id = OP.orders_products_id WHERE O.orders_id = " . $order_id; $result = mysql_query($query); $pdf = new CreateVoucher(); while ($row = mysql_fetch_assoc ($result)) { $name = $row['customers_name']; $pkg = $row['products_name']; $persons = substr($row['products_options_values'], 0, 100); $pdf->addNewVoucher($pkg, $name, $persons, $control_number, $exp_date); } $pdf->outputPdf(); ?>