使用json格式的php登录的webservices

时间:2017-05-11 08:59:16

标签: php

    using php    webseriver error coming data not received the issue data in json is not displayed please help me out


<?php

        if(isset($_POST['login'])){
                            include 'includes/config.php';

                            $uname = $_POST['uname'];
                            $pass = $_POST['pass'];

                            $query = "SELECT * FROM drivers WHERE email= '$uname' AND password= '$pass'";
                            $res = $conn->query($query);
                            if(mysqli_num_rows($res)==1)
            {
                $array = array("success" => "TRUE");
               echo  json_encode($array);
            }
            else
            {
                $array = array("error" => "Login invalid.");
              echo  json_encode($array);
            }
        }
        else
        {
            $array = array("error" => "Data not recieved.");
            echo json_encode($array);
        }

        ?>

    In the above code login webservice usign php to display as in json format success but it showing error:data not received please help me out 

The above code in database values is there but it not showing.

使用php webseriver错误未收到数据未收到json中的问题数据未显示请帮帮我        数据库值中的上述代码存在,但未显示。   使用php webseriver错误未收到数据未收到json中的问题数据未显示请帮帮我

0 个答案:

没有答案