我获取的代码值小于255,但如果列中的值大于255,则不会返回。
<?php
include 'dbconfig.php';
$conn = new mysqli($servername, $username, $password, $dbname);
if($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM news ORDER BY id DESC";
$result = $conn->query($sql);
if($result->num_rows >0){
while($row[] = $result->fetch_assoc()) {
$tem = $row;
$json = json_encode($tem);
}
}else {
echo "0 results";
}
echo $json;
$conn->close();
?>
答案 0 :(得分:0)
将您的代码更改为:
t.string :category_name
t.string :status