127.0.0.1目前无法处理此请求

时间:2016-08-25 10:37:07

标签: php android login localhost bitnami

请帮我调试下面用php编写的代码。 127.0.0.1目前无法处理此请求。

这是php脚本

<?php
require "init.php";
$user_name = "shiko123";
$user_pass = "shiko@321";

$sql_query = "select name from user_info where user_name like '$user_name'and user_pass like '$user_pass';";
$result = mysqli_query($conn,$sql_query);

if(mysqli_num_rows($result) > 0)
{
    $row = mysqli_fetch_assoc($result);
    $name = $row["name"];
    echo "<h3> Welcome".$name"</h3>";
}
else
{
    echo "No information available";
}
?>

1 个答案:

答案 0 :(得分:1)

使用else关闭}。它应该是这样的

&#13;
&#13;
<?php
require "init.php";
$user_name = "shiko123";
$user_pass = "shiko@321";

$sql_query = "select name from user_info where user_name like '$user_name'and user_pass like '$user_pass';";
$result = mysqli_query($conn,$sql_query);

if(mysqli_num_rows($result) > 0)
{
    $row = mysqli_fetch_assoc($result);
    $name = $row["name"];
    echo "<h3> Welcome".$name"</h3>";
}
else
{
    echo "No information available";
}
?>
&#13;
&#13;
&#13;