传递了无效的参数join() [英] Invalid arguments passed join()

查看:143
本文介绍了传递了无效的参数join()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我制作了该脚本,应使用mysqli_fetch_arraymysqli_query来获取数组,所有脚本都可以正常工作,并且不会显示任何错误,但是在我更改了某些内容之后,使用了另一个函数,例如,如果我更改了心情,昵称或其他任何内容,均显示错误

So I made this script that should fetch an array using mysqli_fetch_array and mysqli_query it all works fine, and no error shows up, but then after I change something, using another function, for example, If I change the mood, nickname or whatever, it shows an error

Warning: join(): Invalid arguments passed in Main.php on line 526

我一直在尝试使用while loop修复此问题,并且发生了相同的事情

Iv'e been trying to fix this using a while loop and the same thing happens

$info = mysqli_fetch_array(mysqli_query($con, "SELECT id, nickname, mood, credits, colour, curhead, curface, curneck, curbody, curhands, curfeet, curflag, curphoto, rank * 146 FROM `sync_users` WHERE id='" . mysqli_real_escape_string($con, $raw[5]) . "';"), MYSQLI_ASSOC);
$client->sendPacket("%xt%gp%-1%" . join("|", $info) . "%");
print str_replace('Array', '', print_r($info, true));

我试图问其他几个了解php的朋友,他们也无法给我解决方案.

I tried asking a few other friends who knew php well and they were unable to give me a solution as well.

推荐答案

以下是有关基本调试的课程:

如果PHP函数抱怨输入参数,验证这些参数将是一个好主意.因此,添加

var_dump($info);

您的代码很可能会输出(bool)false

to your code will most likely output (bool)false

这使我们相信SQL查询不返回任何行,因此是时候对该查询进行调试了.

Which lead us to believe that SQL query returned no rows, and so it's time to debug the query.

希望有帮助

这篇关于传递了无效的参数join()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆