title: php mysql updating a row and sending a email with the updated information
body: <p>I'm trying to update a row in a database, and sening the user an email with the updated information. when i seperate these two codes, they work fire. But combines they dont work.
  Im generating a random number that will be updated into the database and ill send like i said the random number to the user itself.</p>
  
  <pre><code>&lt;?php
      $kcr = mt_rand(10000,1000000);
          $to = $_GET['to'];
  
          $headers = "MIME-Version: 1.0" . "\r\n";
          $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
          $headers .= 'From: &lt;account@directofficesupport.com&gt;' . "\r\n";
  
          $subject = "Uw account is successvol aangemaakt!";
  
          //begin body message
          $body = '&lt;b&gt;&lt;h4&gt;&lt;font face="verdana"&gt;Bedankt voor uw registratie op DirectOfficeSupport.com, Uw account is successvol aangemaakt!&lt;/font&gt;&lt;/h4&gt;&lt;/b&gt;&lt;p&gt;';
          $body .= '&lt;font face="verdana"&gt;Uw unieke verificatiecode: &lt;b&gt; '.$kcr.'&lt;/b&gt;&lt;p&gt;';
  
  
  
          //end body message
           $from = 'account@directofficesupport.com';
           (mail($to, $subject, $body, $headers)) 
  
  
  
      &lt;?php mysql_connect("localhost", "pp_12034_23", "BireBA82R5Nd") 
      or die("Connection Failed"); mysql_select_db("db_12034_23")or die("Connection Failed");
  
  
  
       $query = "UPDATE voskousers SET Kc = '$kcr' WHERE Email = '$to'"; if(mysql_query($query)){} else{ echo "fail";} 
               ?&gt; 
  </code></pre>
  
  <p>I get a white screen when i try these two codes combined.
  I hope anyone has a solution.</p>