z-victoria Posted April 14, 2009 Share Posted April 14, 2009 Hey Guys, newbie here so bear with me Right basically I'm trying to get my default image location into the database but I'm getting a sql warning..."missing argument 5 for addnewuser in ...blah blah blah... on line 37" I've only been doing PHP and SQL for just under a month and hav'nt come accross this error before. My database table is in the following order: - username - password - email - country - imagelocation - id the addnewuser function is: function addNewUser($username, $password, $email, $country, $location){ global $conn; $q = "INSERT INTO user_info (username, password, email, country, imagelocation) VALUES ('$username', '$password', '$email', '$country', '$location')"; return mysql_query($q,$conn) or die(mysql_error()); line 37 is where the $q is and the image bit is further up my page of code so above the function.. $location = "images/avatars/default.jpg"; the rest of the script is working fine it's just that bit giving out the error and not storing the image location into the database any clues ??? - i've been trying to work it out for hours, searching on Google etc with no luck at all - might just be me being silly and missing a really tiny thing as per usual lol! thanks in advance guys x Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted April 14, 2009 Share Posted April 14, 2009 where are you calling the function addNewUser? because you are missing the 5th argument $location Quote Link to comment Share on other sites More sharing options...
z-victoria Posted April 14, 2009 Author Share Posted April 14, 2009 OMG! I'm so flippin silly! $_SESSION['regresult'] = addNewUser($_POST['user'], $md5pass, $email, $country); forgot to add it on the end! Arghhh! thanks MasterACE14 LOL x Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted April 14, 2009 Share Posted April 14, 2009 haha, no problem. 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.