Need help with implode function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scatfly
    New Member
    • May 2007
    • 3

    Need help with implode function

    I have a set of values that were put into a form and am now using this to put into a database. this is my error:

    "Warning: implode() [function.implod e]: Bad arguments. in /home/xxxxxx/public_html/login.php on line 177
    Couldn't execute insert query."

    [PHP]
    $today = date("Y-m-d");
    $fields_str = implode(",",$fi elds);
    $values_str = implode('","',$ values); <=line 177
    $fields_str .=",createdate" ;
    $values_str .='"'.",".'"'.$ today;
    $fields_str .=",password" ;
    $values_str .= '"'.","."md5"." ('".$password." ')";
    $sql = "INSERT INTO member ";
    $sql .= "(".$fields_str .")";
    $sql .= " VALUES ";
    $sql .= "(".'"'.$values _str.")";
    $result = mysql_query($sq l,$con)
    or die("Couldn't execute insert query.");
    $_SESSION['auth']="yes";
    $_SESSION['logname'] = $loginname;
    [/PHP]
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Originally posted by scatfly
    $values_str = implode('","',$ values); <=line 177
    Hi.

    Try replacing the '","' with ','

    Comment

    Working...