News for hackers. Stuff that matters.
Re:PHP: The Right Way by sopooneo on Saturday July 07, 2012 @09:02PM (#4213207)
One thing I've run into is that PDO does not let you parameterize the field name in "ORDER BY" clauses. And there are a few other little things that I've wanted to do that it doesn't allow. It may be that me even running into these problems means I'm doing something wrong at a structural level. Regardless, in those statements where I want something to be dynamic, but it's not allowed by PDO, I do an exact equality check against a white list.
Re:PHP: The Right Way by jasonlotito on Saturday July 07, 2012 @11:59PM (#4213568)
Well, that's not what binding is supposed to do. After all, field names aren't something you should be exposing at all.

> I do an exact equality check against a white list.

Pretty much the way you are supposed to do it (except, I'd actually use the value in the white list rather than the matched input value, as the two should not be the same).