dqwh1205 2013-06-20 23:07
浏览 22
已采纳

页面配置不正确?

I moved my files from my Xampp server over to a live server and now the PHP doesn't seem to be working correctly. This file is the problem

<?php

require ("../Android/connect.php");
require ("../Android/queries.php");

if ($query_run = mysql_query($questions_query)) {
    if (mysql_num_rows($query_run) == NULL) {       
        $response["success"] = 0;         
        echo json_encode($response);

    } else {            
        $response ['questions'] = array();      
        while ($row = mysql_fetch_assoc($query_run)) {
            $info = array();
            $info ['display_name'] = $row['display_name'];
            $info ['field_type'] = $row['field_type'];
            $info ['option_value'] = $row['option_value'];          

            array_push($response["questions"], $info);          
        }
        // success
        $response["success"] = 1; 
        // echoing JSON response
        echo json_encode($response);
    }
}
?>

My Android app that was getting JSON from this file now gets null JSONObjects. When I open it in my browser it gives me this error:

"Server error
The website encountered an error while retrieving http://mysite.com/Android/myfile.php. It may be down for maintenance or configured incorrectly."

My first thought was my connect.php or queries.php that are included were at fault. However they work fine. I can get them to display in my browser or echo out messages to me. The file above however will not work. Anyone know what the problem is?

  • 写回答

1条回答 默认 最新

  • dousidan1279 2013-06-20 23:21
    关注
    if ($query_run = mysql_query($questions_query)) {
    

    Be sure to define $questions_query- looks like that's your problem right there

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端