Jump to content

[SOLVED] IMPLODE Bad Arguments


d22552000

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.