title: MySQL function return value from row in table
body: <p>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'</p>
  
  <p>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.</p>
  
  <pre><code>DECLARE @url VARCHAR;
  SET @url = '';
  SELECT p.value INTO @url FROM Parameters p WHERE p.Term = 'Base URL';
  RETURN @url;
  </code></pre>
  
  <p>I am getting an error 1064 near "<code>DECLARE @url VARCHAR(255); SET @url = ''; SELECT p.value INTO @url FROM Param</code>"</p>
  
  <p>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?</p>
  
  <p>Thanks!</p>