This stored procedure is not filtering when called up, I will appreciate any advice:
USE invoicing;
DELIMITER //
CREATE PROCEDURE get_payments(client_id INT, payment_method_id TINYINT)
BEGIN
SELECT *
FROM payments p
WHERE
p.client_id = IFNULL(client_id, p.client_id) AND
p.payment_method = IFNULL(payment_method, p.payment_method);
END //
DELIMITER ;
CALL get_payments(5,2);