<?php
?require_once('conn.php'); // 連線資料庫
require_once('functions.php');
# $sql = "SELECT * FROM news order by id desc";
$info = mysql_query( $sql);
?>
<?php
$servername = "localhost";
$username = "root";
$password = "root";
#// 建立連線
$conn = mysqli_connect($servername, $username, $password);
mysqli_set_charset($conn, 'utf8' );
mysql_select_db("article");
// 偵測連線
if (!$conn) {
? ? die("Connection failed: " . mysqli_connect_error());
}
//echo "連線成功";
?>
以上是conn.php的內(nèi)容
functions.php 不知道是什麼內(nèi)容剛開始學(xué)習(xí)還沒弄清楚這個檔案要實(shí)現(xiàn)什麼作用