[請益]有關移機的相關問題

看板PHP作者 (阿銜)時間13年前 (2012/08/20 15:16), 編輯推噓1(105)
留言6則, 2人參與, 最新討論串1/2 (看更多)
最近碰到有客戶要移機裡面是PHP的系統語言, 小弟知道移機需要重新修改主機名稱及資料庫連結, 可是看了老半天知道要改的地方,可是要全改還是改一部分好了? 特地上來跪求各位大大的幫忙>""< 以下是程式語言的部分~ class mysql { var $link; var $result; function connection(&$DB_info, $conn_mod = false){ $DB_host = $DB_info['host'] ? $DB_info['host'] : 'localhost'; $DB_user = $DB_info['user']; $DB_pw = $DB_info['password']; $connect_function = $conn_mod ? 'mysql_pconnect' : 'mysql_connect'; if($DB_host && $DB_user && $DB_pw) $conn = $connect_function($DB_host, $DB_user, $DB_pw); elseif($DB_host && $DB_user) $conn = $connect_function($DB_host, $DB_user); elseif($DB_host) $conn = $connect_function($DB_host); else $conn = NULL; if (!$conn) { return database_cannot_connect; } mysql_query("SET NAMES 'UTF8'"); if ($DB_info['dbname']) mysql_select_db($DB_info['dbname'], $conn) or die ("Unable to select database"); $this->link = $conn; //echo $this->link; return $conn; } function ExecSQL($SQLstr){ $result = mysql_query($SQLstr, $this->link); if(!$result){ echo mysql_errno(). ": ".mysql_error(). "<br>"; exit(); } $this->result = $result; } function fetchRow() { return mysql_fetch_array($this->result); } function fetchNum() { return mysql_num_rows($this->result); } function disconnect() { mysql_close($this->link); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.42.12.88

08/20 15:26, , 1F
這邊看起來,貌似都不用改 XD
08/20 15:26, 1F

08/20 20:43, , 2F
var 可能會有問題
08/20 20:43, 2F

08/20 20:45, , 4F
後面+.php , 會有介紹。 php5 以上的 var 不推薦使用了
08/20 20:45, 4F

08/20 22:44, , 5F
原來是換版本喔 XD 我以為是換資料庫info...
08/20 22:44, 5F

08/20 23:15, , 6F
移機應該都會換吧,當然版本一樣就沒問題囉
08/20 23:15, 6F
文章代碼(AID): #1GCUGmbc (PHP)
文章代碼(AID): #1GCUGmbc (PHP)