<?php
$user = '...';
$password = '...';
$db = '...';
$host = '...';
$port = ....;
$link = mysqli_init();
$success = mysqli_real_connect(
$link,
$host,
$user,
$password,
$db,
$port
);
// mysqli_query($success, "set names utf8");
$sql = "SELECT * FROM nodes";
$nodesPHP = mysqli_query($success, $sql);
$err = mysqli_connect_error();
echo $err;
echo $nodesPHP;
echo $success;
?>
因为之前php文件一直得不到sql数据所以单独写了一个php用来测试,
发现页面上只有"echo $success"打印的"1", err和nodesPHP都为"", 但是实际上database里应该是有数据的,权限也检查过了,一直找不到问题出在哪里
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…