fork download
  1. <?php
  2.  
  3. $stmt = $con->prepare("SELECT ca.id_cashier,
  4. cr.cash_register,
  5. ent.tradename,
  6. bo.tradename,
  7. u.first_name,
  8. u.last_name,
  9. ca.open_date,
  10. ca.open_amount,
  11. ca.close_date,
  12. SUM(i.amount_total) AS sales_day,
  13. ca.open_amount + COALESCE(SUM(i.amount_total), 0) AS total_amount,
  14. ca.status
  15. FROM tbl_cashier AS ca
  16. LEFT JOIN tbl_invoice AS i USING (id_seller)
  17. LEFT JOIN tbl_cash_register cr ON ca.id_cash_register=cr.id_cash_register
  18. LEFT JOIN tbl_users u ON ca.id_seller=u.id_user
  19. LEFT JOIN tbl_enterprise ent ON i.id_enterprise=ent.id_enterprise
  20. LEFT JOIN tbl_branch_office bo ON i.id_branch_office=bo.id_branch_office
  21. WHERE ca.id_seller = ?
  22. AND (
  23. i.id_invoice IS NULL
  24. OR (
  25. i.payer_date >= ca.open_date
  26. AND (
  27. ca.close_date IS NULL
  28. OR i.payer_date <= ca.close_date
  29. )
  30. )
  31. )
  32. OR ((? IS NULL) OR u.first_name LIKE ?)
  33. GROUP BY 1 DESC LIMIT ?, ?");
Runtime error #stdin #stdout #stderr 0.02s 26160KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Undefined variable: con in /home/hnupSE/prog.php on line 3
PHP Fatal error:  Uncaught Error: Call to a member function prepare() on null in /home/hnupSE/prog.php:3
Stack trace:
#0 {main}
  thrown in /home/hnupSE/prog.php on line 3