Too few arguments?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thumbliner
Forum Newbie
Posts: 6
Joined: Mon Apr 25, 2011 1:21 pm

Too few arguments?

Post by thumbliner »

The irritating novice is back!! :mrgreen:

Hey guys, need your help again.

I just coded an INSERT records page. But after all was done, this is the error I am getting. I fill the form and when I click, INSERT. I get this error.

Why?

Image
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: Too few arguments?

Post by internet-solution »

whats in the GetSQLValueString() function?
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Too few arguments?

Post by McInfo »

This statement prints the string "hello world".

Code: Select all

echo sprintf('%s %s', 'hello', 'world');
This statement triggers an error because the format string tells sprintf() to make two substitutions but there are only enough arguments to do one substitution.

Code: Select all

echo sprintf('%s %s', 'hello');
If you read the error message, it tells you exactly what the problem is.
Warning: sprintf(): Too few arguments in C:\wamp\www\dwwithphp\admin_add_pilot.php on line 57
  • The type of error is E_WARNING.
  • The function that triggered the error is sprintf().
  • The reason for the error is that there were fewer arguments passed to the function than expected.
  • The error was discovered in the file "C:\wamp\www\dwwithphp\admin_add_pilot.php".
  • The error was discovered on line 57, but may have been caused by something before that line.
Post Reply