I'd like to know how I can create a MySQL function that declares 2 variables by using 1 select statement. Something like this:
CREATE FUNCTION `inHashtagCampaign` (campaignId INT,startDateTime DATETIME,endDateTime DATETIME)
RETURNS TEXT
LANGUAGE SQL
DETERMINISTIC
BEGIN
DECLARE result TEXT;
DECLARE limit BIGINT(11);
DECLARE suspended TINYINT(1);
#
#I don't know how to do this, but I'd like to use the result of this query:
#
result = SELECT `limit`,`suspended` FROM `settings` WHERE `campaignId` = 2;
limit = result.limit;
suspended = result.suspended;
END;
I know this function is far from complete, but I'm kinda stuck on this thing already.
I think what you are trying to do is like this
(OR)