當前位置:首頁 » 編程語言 » 織夢sql如何導入新站
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

織夢sql如何導入新站

發布時間: 2023-08-29 23:50:24

A. 織夢系統(dede)支持sql2000嗎

原則上是支持的,但是DEDE的環境是用PHP+MYSQL來建設的,還好創始人開始的過程比較規范化,算是符合MVC的結構,如果你想用別的資料庫,如SQL2000來代替MYSQL,那麼你就要把資料庫操作基類換掉,
資料庫基類存放的位置:/include/dedesql.class.php

你要做的工作就是保持這個類的所有屬性和方法,然後把MYSQL的函數換成MSSQL的函數。

mssql_bind -- Adds a parameter to a stored procere or a remote stored procere
mssql_close -- Close MS SQL Server connection
mssql_connect -- Open MS SQL server connection
mssql_data_seek -- Moves internal row pointer
mssql_execute -- Executes a stored procere on a MS SQL server database
mssql_fetch_array -- Fetch a result row as an associative array, a numeric array, or both
mssql_fetch_assoc -- Returns an associative array of the current row in the result set specified by result_id
mssql_fetch_batch -- Returns the next batch of records
mssql_fetch_field -- Get field information
mssql_fetch_object -- Fetch row as object
mssql_fetch_row -- Get row as enumerated array
mssql_field_length -- Get the length of a field
mssql_field_name -- Get the name of a field
mssql_field_seek -- Seeks to the specified field offset
mssql_field_type -- Gets the type of a field
mssql_free_result -- Free result memory
mssql_free_statement -- Free statement memory
mssql_get_last_message -- Returns the last message from the server
mssql_guid_string -- Converts a 16 byte binary GUID to a string
mssql_init -- Initializes a stored procere or a remote stored procere
mssql_min_error_severity -- Sets the lower error severity
mssql_min_message_severity -- Sets the lower message severity
mssql_next_result -- Move the internal result pointer to the next result
mssql_num_fields -- Gets the number of fields in result
mssql_num_rows -- Gets the number of rows in result
mssql_pconnect -- Open persistent MS SQL connection
mssql_query -- Send MS SQL query
mssql_result -- Get result data
mssql_rows_affected -- Returns the number of records affected by the query
mssql_select_db -- Select MS SQL database

B. 同一個伺服器,不同資料庫的2個織夢網站數據數據怎麼調用

織夢dedecms資料庫不在同一個伺服器,數據調用方法!

data/common.inc.php

這個是保存資料庫連接信息的,改下這個文件就可以了。

<?php

//資料庫連接信息

$cfg_dbhost = 『localhost』;

$cfg_dbname = 『dedecmsv56gbk』;

$cfg_dbuser = 『root』;

$cfg_dbpwd = 『abcdefghijk』;

$cfg_dbprefix = 『dede_』;

$cfg_db_language = 『gbk』;

?>

第一個要改的就是cfg_dbhost資料庫伺服器地址,

如果不是和WEB空間在同一個伺服器,填上IP就可以了,

在同一個伺服器一般使用localhost或者127.0.0.1

$cfg_dbhost = 』123.456.789.123′;

$cfg_dbname = 」; 這個是資料庫名稱

$cfg_dbuser = 」; 這個是資料庫的用戶名

$cfg_dbpwd = 」; 資料庫密碼

$cfg_dbprefix = 『dede_』; 這個是數據表的前綴

$cfg_db_language = 『gbk』; 這個是資料庫的編碼,一定要兩個DEDE站點的編碼一樣,如果不同就會出現亂碼。

注意一下哦,有很多空間商是不允許外部鏈接到資料庫的,所以你要向他們咨詢下是否可以在外站連接。

同一伺服器,不同資料庫!

{dede:sql sql="SELECT id as tmd,title FROM `另外個站的資料庫名`.`dede_archives` ORDER BY tmd desc LIMIT 0,10"}

<li><a href=https://www.xiaoyuani.com/plus/view.php?aid=[field:tmd/] title="[field:title/]" target="_blank">[field:title /]</a></li>

{/dede:sql}