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
https://forums.phpfreaks.com/topic/153972-solved-sql-missing-argument/
Share on other sites

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.