Hi,
How to make MySQL function that returns list of data.
Here is the mockup that i want
Plus how do i assign value of a column into MySQL variable.
Here is the mockup of what i want.
I know the codes above are totally wrong in syntax :p
Thanks for helping. :D
How to make MySQL function that returns list of data.
Here is the mockup that i want
Code:
function get_users() {
@data = SELECT * FROM users;
RETURN @data;
}
Plus how do i assign value of a column into MySQL variable.
Here is the mockup of what i want.
Code:
SELECT
users.name,
@var_a = (
SELECT COUNT(*) FROM pets WHERE pets.owner_id = users.user_id
) AS pet_count
FROM
users
WHERE
@var_a > 10
I know the codes above are totally wrong in syntax :p
Thanks for helping. :D
Last edited:





