LuizFernando Posted November 26, 2017 at 05:00 PM Share Posted November 26, 2017 at 05:00 PM Estou com esse seguinte erro: PHP Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result, boolean given in /home/mtorigem/public_html/paginas/home/shop.php on line 57 Segue abaixo a linha 57: while ($array = mysqli_fetch_object($query)) { Link to comment Share on other sites More sharing options...
juniorsilva Posted November 26, 2017 at 08:19 PM Share Posted November 26, 2017 at 08:19 PM verifique se o argumento adicionado é valido..... Exemplo: <?php $con = @mysqli_connect("localhost", "root", "123456", "account", 3306); if (mysqli_connect_errno()) { printf("Erro, não foi possível conectar ao servidor MySql: %s<br/>", mysqli_connect_error()); exit(); } if ($query = mysqli_query($con, "SELECT name,level FROM player.player ORDER BY level desc, exp desc LIMIT 5;")) { while ($array = mysqli_fetch_object($query)) { printf("%s (lv.%d)<br/>", $array->name, $array->level); } mysqli_free_result($query); }else{ print "Erro, não foi possível fazer a consulta.<br/>"; } mysqli_close($con); ?> Link to comment Share on other sites More sharing options...
LuizFernando Posted November 27, 2017 at 11:29 AM Author Share Posted November 27, 2017 at 11:29 AM Segue o arquivo que está com erro. shop.php Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now