<?php
require_once('conn.php'); //连接数据库
require_once('functions.php');
$sql = "SELECT * FROM news order by id desc";
$info = mysql_query($sql);
?>
phpcn_u838682018-05-29 11:18:20
<?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
sky2018-04-12 17:59:25
If it is not a framework, it will be in the same directory.
There is also a problem with your database link