title: Issue while trying to echo a MYSQL table
body: <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  function doConnect()
  {
     $trueServer = "X";
     $trueDb = "X";
     $trueUser = "X";
     $truePassword = "X";
      mysql_connect($trueServer, $trueUser, $truePassword) or trigger_error(mysql_error());
     mysql_select_db($trueDb) or trigger_error(mysql_error());
  } 
  
  $currentlang = $_SESSION['lang'];
  
  function my()
  {
     global $pnew;
     global $pnewLine;
     global $pnX;
     global $currentlang;
     doConnect();
     $pnew = mysql_query("SELECT * FROM tutorials WHERE cat='ppn' AND lang='".$currentlang."' ORDER BY id DESC");
     while($pnewLine = mysql_fetch_array($pnew))
     {
        $pnX = $line['text'];
     }
     echo $pnX;
  }
  
  my();
  
  ?&gt;
  </code></pre>
  
  <p>I'm trying to select a table row and echo it, if I use it without the <code>my();</code> function it works just like a charm, instead it just doesn't echo. </p>
  
  <p><em>Now you ask me: why don’t you remove these functions and use pure PHP instead? A: I’m using the <code>include</code> function (I don’t know its real name) and it is working pretty fine.</em></p>
  
  <p>By the way, the <code>doConnect();</code> function is working fine. So far I've tried using global variables but it is still not working.  Thanks for your attention!</p>