从mysql打印数组

时间:2018-01-15 12:07:31

标签: php mysql arrays

我正在尝试将数组从mysql表数据打印到物理打印机,我尝试过这种方法,但它会打印一个空页

$queryString = "SELECT * FROM items WHERE order_id='".$order_id."' and confirm_order='0'";
$fetch = mysql_fetch_array(mysql_query($queryString));

                $handle = printer_open("POS");
                printer_start_doc($handle, "My Document");
                printer_start_page($handle);
                $font = printer_create_font("Arial", 35, 20, 300, false, false, false, 0);
                printer_select_font($handle, $font);

                while ($row = mysql_fetch_array($fetch)) {
                    printer_draw_text($handle, $row[item_quantity], 10, 10);                
                }

                printer_delete_font($font);
                printer_end_page($handle);
                printer_end_doc($handle);
                printer_close($handle);

0 个答案:

没有答案