jim.davidson Posted August 10, 2012 Share Posted August 10, 2012 I get this error Warning: sprintf() [function.sprintf]: Too few arguments in C:\Sites\vfd\vfd_update_practices.php on line 126 I've tried finding the answer to this but I can't see any thing wrong with the code could someone look at this and tell me what I'm missing? Any and all help will be greatly appreciated. $colname_getPractice = "-1"; if (isset($_GET['practice_id'])) { $colname_getPractice = $_GET['practice_id']; } (I've done an echo here and $colname_getPractice has a valid value of 3 in it) $query_getPractice = sprintf("SELECT DATE_FORMAT(practice_date, '%m/%d/%Y') AS practice_date, practice_time, practice_description, practice_id FROM practices WHERE practice_id = %s", GetSQLValueString($colname_getPractice, "int")); Quote Link to comment https://forums.phpfreaks.com/topic/266922-too-few-arguments/ Share on other sites More sharing options...
xyph Posted August 10, 2012 Share Posted August 10, 2012 You need to use a double % (%%) when you want a literal percentage character in your first argument. http://php.net/manual/en/function.sprintf.php Quote Link to comment https://forums.phpfreaks.com/topic/266922-too-few-arguments/#findComment-1368460 Share on other sites More sharing options...
jim.davidson Posted August 10, 2012 Author Share Posted August 10, 2012 Thank you very much, now that I see that, the error makes sense. Quote Link to comment https://forums.phpfreaks.com/topic/266922-too-few-arguments/#findComment-1368465 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.