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. Quote Link to comment 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','ammosource@gmail.com'' 2007-11-10 18:59:56') Column count doesn't match value count at row 1 Quote Link to comment 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 ", '" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.