<?php
?require_once('conn.php'); //連接數(shù)據(jù)庫
?require_once('functions.php');
?$sql = "SELECT * FROM news order by id desc";
?$info = mysql_query($sql);?
?>
<?php
$servername = "localhost";
$username = "root";
$password = "root";
// Create connection
$conn = mysqli_connect($servername, $username, $password);
mysqli_set_charset($conn, 'utf8' );
mysql_select_db("article");
// Detect connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
//echo "Connection successful";
?>
The above is the content of conn.php
functions.php I don’t know what it is. I just started learning and haven’t figured out what this file is supposed to do
If it is not a framework, it will be in the same directory.
There is also a problem with your database link