[PHP]: Error -> Too few arguments in sprintf();

php

Solution

Well, your string specifies 12 placeholders and you only provide 9 values. The `sprintf` function requires that you pass as many values as the number of placeholders you specify in the format string. I actually think the error message is strikingly clear and is about as good an error message as you will ever see.

Problem

This line is giving error: "Too few arguments". What is the problem? ``` $InsertQuery = sprintf("INSERT INTO listing (ldate, places, company, designation, projectdetails, desiredcandidate, hrname, hrcontact, email) VALUES (DATE_FORMAT(%s,'%Y %m %d),%s,%s,%s,%s,%s,%s,%s,%s)", $ldate,$places,$company,$designation, htmlentities($projectdetails), htmlentities($desiredcandidate),$hrname,$hrcontact,$email); ```

Original source