I am trying to return a value from a table. The table is a parameter table that will have it's value changed in the future. The table name is 'Parameter' and I'm trying to get the value from the value column where the term is = 'Base URL'
In PHP My Admin, I am creating a function with the following query and it's giving me an error. I can't seem to locate the error.
DECLARE @url VARCHAR;
SET @url = '';
SELECT p.value INTO @url FROM Parameters p WHERE p.Term = 'Base URL';
RETURN @url;
I am getting an error 1064 near "DECLARE @url VARCHAR(255); SET @url = ''; SELECT p.value INTO @url FROM Param
"
Where is my error? I couldn't find a similar situation. I have used parameter tables in the past, but never created one or a function to go along with it. Is there a better way to do what I want?
Thanks!