php代码在浏览器

时间:2016-10-13 13:11:14

标签: php

Hie.My php代码在我的browser.its上返回实际代码。没有给出output.it只显示代码。

<?php
$servername = "localhost";
$username = "root";
$password = "";


$db_name="agric";
// Create connection
$conn = new mysqli_connect("$servername", "$username", "$password",);
mysql_select_db($db_name)or die("Could not connect to database");

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 
echo "Connected successfully";
?>

我的数据库是agric,我使用xampp创建它。有人帮我解决了问题。

0 个答案:

没有答案