mysqli

<?php 

$host="localhost";

$user="";

$password="";

$database = "";

$id = "";

$conn = new mysqli($host, $user, $password,$database);
if (!$conn) {
            die('can not connect database! </br> Error: '.mysqli_connect_error());
}
$conn->query("SET NAMES utf8");

$sql="select post_content from wp_posts where id='$id'";
$query = mysqli_query($conn,$sql);
$array = mysqli_fetch_array($query);
$response = $array[0];
//mysqli_close($conn);

echo $response;

?>


发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注