I have created a stored procedure to count the number of works for each technician using the ID of that technicain and the intended year as a inputs to that stored procedure, but I have stucked to . . . How can I get an array of output in that procedure so that I can use it later in my code in php for example. Here is my stored procedure:
DROP PROCEDURE `work_count`;
CREATE DEFINER=`root`@`localhost` PROCEDURE `work_count`(IN `id` INT, IN `yearInput` INT) NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER
BEGIN
SET @x := 1;
WHILE @x<13 DO
SELECT COUNT(work.workType)
FROM work
WHERE year(workDate)=yearInput
AND work.technicianID = id
AND month(workDate)= @x;
SET @x := @x+1;
END WHILE;
END