I use this almost on a daily basis, and yet I can't commit it to memory. So I don't have to go searching for it each time I need to write it…
I use this almost on a daily basis, and yet I can't commit it to memory. So I don't have to go searching for it each time I need to write it…
3 | Jordan
September 17th, 2003 at 6:06 pm
You shouldn't be using sprintf() in this context, as you're not doing any special formatting. Just use simple string concatenation. This is one of the Top 21 PHP programming mistakes: http://www.zend.com/zend/art/mistake.php#Heading4
4 | Jennifer
September 17th, 2003 at 6:19 pm
Hmm… my experience is that this works better when constructing query statemtents. Simple string concatenation does not seem to work consistently.
5 | Jennifer
September 17th, 2003 at 6:44 pm
In the above example, it's simple enough that concatenation works (i just tested it) – however, I've gotten into the habit of using sprintf because, for reasons I can never figure out – sometimes it won't construct the query statement unless I use sprintf.
6 | Jordan
September 22nd, 2003 at 2:26 am
Curious. Never had a problem with such, but I'll take your word for it.
7 | ScriptKiddie
Warning: Supplied argument is not a valid MySQL result resource in ….etc.
Your code does not work.