Jump to content

[SOLVED] SQL Missing Argument..


z-victoria

Recommended Posts

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

 

 

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.