Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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));

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
317 views
Welcome To Ask or Share your Answers For Others

1 Answer

One or more elements of the array isn't a string. Either cast the offending fields in the query, or pass all the fields through strval() first.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...