【问题标题】:how to get data mysql with shimmer on android studio如何在 android studio 上使用 shimmer 获取数据 mysql
【发布时间】:2018-07-20 09:52:00
【问题描述】:

当我在手机上运行时,它没有在我的数据库中获取数据 sql“无法获取菜单!请再试一次。”

这是我的 php 代码:

<?php 

require_once "../include/Constants.php";

$conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

    $stmt = $conn->prepare("SELECT id, name, description FROM newsfeed");

    $stmt->execute();

    $stmt->bind_result($id, $name, $description);

    $newsfeed = array(); 

    //traversing through all the result 
    while($stmt->fetch()){
        $temp = array();
        $temp['id'] = $id; 
        $temp['name'] = $name; 
        $temp['description'] = $description; 
        array_push($newsfeed, $temp);
    }

    //displaying the result in json format 
    echo json_encode($newsfeed);

【问题讨论】:

标签: php android android-studio android-fragments


【解决方案1】:

你写了newsFeedDataList != null而不是你应该写的

if (newsFeedDataList == null){
return ;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-19
    • 1970-01-01
    • 2017-03-20
    • 1970-01-01
    • 1970-01-01
    • 2018-02-28
    相关资源
    最近更新 更多