Location: PHPKode > projects > PhpMyInventory > pmi281/Includes/db.inc.php
<?php

If (!$db) {
   function dbquery($strSQL) {
       global $db;
       If (!$queryValue = @mysql_query($strSQL, $db)) {
           die("<p><font color='red'>Error: ".mysql_error());
       } Else {
           return $queryValue;
       }
   }

   function dbqueryWithAlert($strSQL, $adminEmail, $errorMessage) {
       global $db, $strError, $criticalTransactionError;
       If (!$queryValue = @mysql_query($strSQL, $db)) {
           mail($adminEmail, "PMI Critical Error: ".date("m-d-Y"), $errorMessage);
           $strError = $errorMessage;
           $criticalTransactionError = TRUE;
       } Else {
           return $queryValue;
       }
   }

   $db = mysql_connect('localhost','dbuser','dbpass');
   mysql_select_db('dbname',$db);
}

?>
Return current item: PhpMyInventory