コード例 #1
0
ファイル: sqlquery.class.php プロジェクト: bciv/COMS
 private function getDbConnect($address, $account, $pwd, $name)
 {
     if (DB_TYPE == 'mssql') {
         return mssql_connect($address, $account, $pwd);
     }
     if (DB_TYPE == 'sqlsrv') {
         if (defined('DBITPro_Dev')) {
             $connectionInfo = array("UID" => $account, "PWD" => $pwd, "Database" => $name);
         } else {
             $connectionInfo = array("UID" => $account, "PWD" => $pwd, "Database" => $name);
         }
         $conn = sqlsrv_connect($address, $connectionInfo);
         if (false === $conn) {
             echo "Could not connect.\n";
             die(print_r(sqlsrv_errors(), true));
         }
         return $conn;
     }
     if (DB_TYPE == 'mysql') {
         $conn = mysql_connect($address, $account, $pwd);
         if (false === $conn) {
             echo "Could not connect.\n";
             die(print_r(mysql_errors(), true));
         }
         return $conn;
     }
 }
コード例 #2
0
ファイル: ConDB.php プロジェクト: AdamBahr/Boost_Me
 public function __construct()
 {
     $this->conn = mysql_connect($this->serverName, $this->userName, $this->pass);
     if ($this->conn) {
         if (mysql_select_db($this->database, $this->conn)) {
             $this->flag_conn = 0;
         } else {
             $this->flag_conn = 1;
             die(print_r(mysql_errors(), true));
         }
     } else {
         $this->flag_conn = 1;
         die(print_r(mysql_error(), true));
     }
 }
コード例 #3
0
ファイル: contact.php プロジェクト: jdavis593/appitechture
function db_test()
{
    if ($conn === false) {
        die(print_r(mysql_errors(), true));
    }
}
コード例 #4
0
ファイル: mysql.class.php プロジェクト: nekleenov/sampucp
 public function query($query)
 {
     $query = mysql_query($query) or die(mysql_errors(mysql_error()));
     return $query;
 }