title: I get "undefined variable" error on my code after an apache (xampp) reinstall
body: <p>This weekend I formatted and reinstalled my computer: today when I try to continue working on some php pages I've been programming last weeks, when I execute the php code on the localhost server I get an:</p>
  
  <blockquote>
    <p>"Notice: Undefined variable: consulta in D:\WEBS\WP\lbodas.php on line 42 1 de enero de 1970"</p>
  </blockquote>
  
  <p>It's happening on all the php pages that perform an SQL query (wich worked perfectly before the reinstall).</p>
  
  <p>I must be missing some configuration tweak (on php.ini, httpd.conf or some other apache configuration file), can somebody point me out what I'm missing?</p>
  
  <p>Thanks in advance</p>
  
  <hr>
  
  <p>Here is the code I'm using.
  To conect to the DDBB:</p>
  
  <pre><code>$bd_host='localhost';
  $bd_login='MYLOGIN';  
  $bd_clave='MYPASSWORD';
  $bd_nombre='MYDATABASE';
  
  connecttodb($bd_host,$bd_nombre,$bd_login,$bd_clave);
  function connecttodb($bd_host,$bd_nombre,$dbuser,$bd_clave)
  {
      global $conn;
      $conn=mysql_connect ("$bd_host","$dbuser","$bd_clave");
      mysql_query("SET NAMES 'utf8'");
      if(!$conn){die("CONNECTION ERROR");}
      //mysql_query("SET NAMES 'utf8'");
  
      mysql_select_db("$bd_nombre",$conn) or die ("CONNECTION ERROR".mysql_error());
  }
  </code></pre>
  
  <p>And one of the sql queries that used to work but after the reinstall doesn't work:</p>
  
  <pre><code>        $sql = "SELECT * FROM cat_prov ORDER BY categoria ASC";
          $rs_result = mysql_query ($sql, $conn);
  
          while ($row = mysql_fetch_assoc($rs_result)) {
              $categoria=$row["categoria"];
              $notas=$row["notas"];
          }        
  </code></pre>
  
  <p>It's saying that the $row variable, wich holds the array with the results of the sql query, hasn't been defined... but two days ago, before the server OS reinstall I didn't have to define variables!!</p>