Sindbad~EG File Manager

Current Path : /home/beeson/public_html/helpwithmath/
Upload File :
Current File : //home/beeson/public_html/helpwithmath/queryWebGrades.php

<?php
function QueryWebGrades($sql)
    { require_once('DB.php');	  
	  $dsn = array(
                           'phptype'  => "mysql",
                           'hostspec' => "localhost",
                           'database' => "WebGrades",
                           'username' => "beeson",
                           'password' => "euclid#3"
                  );  
	  $db = DB::connect($dsn);
      if (PEAR::isError($db)) 
                  { echo "An error occurred while trying to connect to the database server.<br>\n";
                    echo "Error message: " . $db->getMessage() . "<br>\n";
                    echo "A more detailed error description: " . $db->getDebugInfo() . "<br>\n";
                  }
	   if(DB::iserror($db))
				  return ($db->getMessage());  // instead of "die" 
      $q = $db->query($sql);
	  if(DB::iserror($q))
   		     {   echo "Error message: " . $q->getMessage() . "<br>\n";
                 echo "A more detailed error description: " . $q->getDebugInfo() . "<br>\n";
				 return ($q->getMessage());
			 }
	  return $q;
   }	
 ?>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists