d22552000 Posted November 10, 2007 Share Posted November 10, 2007 Two problems in two situtations with the same code: If I do this: implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $a['inviter'], $email))) ."'". get_date_time() ."')"); It does not expect the last ) out of ))). Although I count three opening (... if I do this: implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $a['inviter'], $email)) ."'". get_date_time() ."')"); It tells me BAD ARGUMENTS. Link to comment https://forums.phpfreaks.com/topic/76771-solved-implode-bad-arguments/ Share on other sites More sharing options...
d22552000 Posted November 10, 2007 Author Share Posted November 10, 2007 ok I fixed that by splitting the hell out of it but now I get these problems: CODE: $ARR = array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $a['inviter'], $email)); $ARG = implode(',', $ARR); $SQL = "INSERT INTO users (username, passhash, secret, "; $SQL.= "editsecret, invitedby, email, added) VALUES ( "; $SQL.= $ARG ."' ". get_date_time() ."')"; $ret = mysql_query($SQL); if (!$ret) { if (mysql_errno() == 1062) bark("Username already exists!"); bark("borked<br><br>$SQL<br><br>".mysql_error()); } The page shows: borked INSERT INTO users (username, passhash, secret, editsecret, invitedby, email, added) VALUES ( 'borked','9cbb2a16555cd15ce365f7abfa40c1b7','ÌLg×–Òxc0>©î{\"—l¹žâR','','1','[email protected]'' 2007-11-10 18:59:56') Column count doesn't match value count at row 1 Link to comment https://forums.phpfreaks.com/topic/76771-solved-implode-bad-arguments/#findComment-388684 Share on other sites More sharing options...
d22552000 Posted November 10, 2007 Author Share Posted November 10, 2007 fixed it was a stupid error "'" should have been ", '" Link to comment https://forums.phpfreaks.com/topic/76771-solved-implode-bad-arguments/#findComment-388687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.