php从mysql获取信息

时间:2017-07-06 19:19:33

标签: php mysql

顺便说一句,我希望通过派系ID获得成员的昵称。但它不是印刷名称。我的代码有什么问题?当我打印$ nickname时它也没有给我任何东西。

function dX=non_L_ss(t,x)
global Fk Fc kt Fa q ds0 ms mu 
dX=[ x(2);
     (Fk*(ds0+x(3)-x(1))-Fk*ds0+Fc*(x(4)-x(2))-kt*x(1))/mu-Fa/m-kt*q/mu ;
     x(4);
     (-Fk*(ds0+x(3)-x(1))+Fk*ds0-Fc(x(4)-x(2)))/ms +Fa/ms ] ;
end

1 个答案:

答案 0 :(得分:0)

这可能会对你有所帮助。添加一个检查以确保您的查询是正确的,所以如果它是,那么它将运行代码,否则它将生成错误:

$query = "SELECT nickname FROM members WHERE fraction = 3";
if ($result = $mysqli->query($query))
{
    if ($result->num_rows > 0)
    {
        while($row = $result->fetch_assoc())
        {
            echo "<p class='monitoring-name'>" . $row['nickname'] . "</p><br>";
        }
    }
    else
    {
        echo "No results found"; // pretty clear?
    }
}
else
{
    // if there's an error with your query it will display this message:
    echo "There was a problem with your query";
}