title: Undefined variable: id PHP
body: <p>Can every explain or show me why i'm getting this Undefined variable: id.</p>
  
  <p>The function</p>
  
  <pre><code>public function getByEmbedId($id, $lang=null){
      $id = mysql_real_escape_string($id);
      $embed = array();
      $e = mysql_query("SELECT * FROM movie_embeds WHERE id='$id'") or die(mysql_error());
      if (mysql_num_rows($e)&gt;0){
          $movie = $this-&gt;formatEmbedData(mysql_fetch_assoc($e), $lang);
      }
      return $embed;
  }
  </code></pre>
  
  <p>And calling the function.</p>
  
  <pre><code>&lt;?php
  
  $embed = $movie-&gt;getByEmbedId($id,$language);  
  if (empty($embed)){
      $embed = '';
  } else { 
      $smarty-&gt;assign("embed",$embed);
  }
  
  ?&gt;
  </code></pre>
  
  <p>If someone can help me out it would be most appreciated</p>