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
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','ammosource@gmail.com'' 2007-11-10 18:59:56')

 

Column count doesn't match value count at row 1

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.