<?php
$servername = "severnam";
$username = "user";
$password = "pass";
$dbname = "db";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>
这是server.php:
<?php
include(../php/db.php);
if (isset($_POST['count'])){
$sql = "SELECT content FROM flow";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo $row["content"];
}
} else {
echo "0 results";
}
$conn->close();
}
?>
cpanel中的文件是这样的:folder layout我是obvios做错了什么...谢谢!当我们关注这个主题时,任何人都可以指出我正确的方向为了在服务器上正确地组织我的文件,女巫应该去哪里......再次感谢。
答案 0 :(得分:0)
尝试从include中删除括号。
In [260]: a1=a.reshape(2,2)[:,1]
In [261]: [i[1] for i in a1]
Out[261]: [[33, 44, 55, 66], [77, 88, 99, 100]]
In [263]: np.array([i[1] for i in a1])
Out[263]:
array([[ 33, 44, 55, 66],
[ 77, 88, 99, 100]])
http://php.net/manual/en/function.include.php
并查看更多信息
编辑:
刚才意识到你的 <?php
// if file way is like that
include "db/db.php";
if (isset($_POST['count'])){
$sql = "SELECT content FROM flow";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo $row["content"];
}
} else {
echo "0 results";
}
$conn->close();
}
?>
中没有php文件夹检查位置。如果db文件夹包含puplic_html
而不是我更正代码。