dbvar.php

来自「use form to access different mysql datab」· PHP 代码 · 共 76 行

PHP
76
字号
<?php
  $connection_method = "mysql";
  
  if($connection_method=="mysql")
  {
    $host='localhost';          // Hostname of MySQL server
    $dbUser='ajax';             // Username for MySQL
    $dbPass='1234';             // Password for user
    $dbName1='hippo_ajax';      // Database name
    $tbName1='t_test';          // Tsble name
    $dbPort ='3306';
  }
  elseif($connection_method=="mssql")
  {
    $host='localhost';            // Hostname of MSSQL server
    $dbUser='sa';                 // Username for MSSQL
    $dbPass='';                   // Password for user
    $dbName1='';                  // Database name
    $dbName2='';                  // Database name
    $tbName1='t_test';            // Tsble name
    $tbName2='t_test';            // Tsble name
  }
  
  $admin_email[0] = "your@mail.com";
  $err_mail_title = "xx_SQL_Error";
  
  $today = getdate();
  $todayyear = $today[year];
  $todayyear = $todayyear-1911;
  $todaymonth =$today[month];
  $todayday = $today[mday];
   
  switch($todaymonth)
  {
    case "January":
      $todaymonth = 1;
      break;
    case "February":
      $todaymonth = 2;
      break;
    case "March":
      $todaymonth = 3;
      break;
    case "April":
      $todaymonth = 4;
      break;
    case "May":
      $todaymonth = 5;
      break;
    case "June":
      $todaymonth = 6;
      break;
    case "July":
      $todaymonth = 7;
      break;
    case "August":
      $todaymonth = 8;
      break;
    case "September":
      $todaymonth = 9;
      break;
    case "October":
      $todaymonth = 10;
      break;
    case "November":
      $todaymonth = 11;
      break;
    case "December":
      $todaymonth = 12;
      break;
  }
  $applydate = $todayyear."-".$todaymonth."-".$todayday;
  
  $client_ip = $_SERVER['REMOTE_ADDR'];
  
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?