Order Confirmation

Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and random =' at line 1 Whole query: select s.name as license, sl.id, s.description, sl.price, sl.qty, p.name, sale.email, sale.first_name, sale.last_name, CONCAT(sale.random, '-', sale.id) as order_number, s.file_name, s.download from sale_line sl join sku s on sl.sku_id = s.id join product p on p.id = s.product_id join sale on sale.id = sl.sale_id where sale.id = and random =