I want display selected table with quantity adding using stored procedure in php
here is my code
DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `GetCustomerLevel`(IN p_barcode INT, OUT q_value INT) BEGIN
DECLARE q1 int; DECLARE q2 int;
DECLARE q3 int; DECLARE total int;
SET total :=0;
SELECT coalesce(sum(adjustment_quantity), 0) INTO q1 FROM adjustment_inventory WHERE item_barcode = p_barcode; SELECT coalesce(sum(opening_stock), 0) INTO q2 FROM openingstock WHERE item_barcode = p_barcode; SELECT coalesce(sum(inwardquantity), 0) INTO q3 FROM inwardmaster WHERE item_barcode = p_barcode; set total = q1+q2+q3; set q_value = total;
END$$ DELIMITER ;
When i call the particular data display but i want display selected table and if adding quantity display only positive and 0 not minus value show in php