Assign results as variables

I want to create function and I need to get the results 2 columns and assign them to variables so I can use them again, but for some reason I can only get it to work if I run the select statement twice :

SELECT lng INTO @zlng FROM zipcodes WHERE zip=@z LIMIT 1;
SELECT lat INTO @zlat FROM zipcodes WHERE zip=@z LIMIT 1;

I get an “Undeclared variable: lat” error if I try this:

SELECT lng INTO @zlng, lat INTO @zlat FROM zipcodes WHERE zip=@z LIMIT 1;

Is there a way to do both into one statement? Thanks!


SELECT lng, lat INTO @zlng, @zlat

Thank you, sir!

Related Question, when I try and call a stored procedure, it errors with “can’t return a result set in the given context”. I tried a super simple one:

delimiter |
CREATE PROCEDURE getall()
	BEGIN
		SELECT storeno FROM locations;
	END |
delimiter ;

and call it with

CALL getall();

. How do I return the results? Thanks.