| bio | website | 127.0.0.1 |
|---|---|---|
| location | Richmond, VA | |
| age | 37 | |
| visits | member for | 1 year, 3 months |
| seen | Apr 17 '12 at 23:54 | |
| stats | profile views | 0 |
OK, i have to rant for a second. Why is it that of the thousands of posts of PHP/MySQL advice on SO, about 99.5% are still using mysql_query -- and about half of those could be the poster child for SQL injection?
It's really not that hard, y'all...
$db = new PDO(...);
$stmt = $db->prepare('
SELECT some_stuff
FROM some_table
WHERE some_field = ?
');
$stmt->execute(array('some value'));
while ($row = $stmt->fetch())
{
...
}
I don't want to have to start calling people out on it, but seriously, prepared statements aren't just safer, they're freaking easier. Learn them or quit calling yourself a PHP programmer.
This user has not asked any questions
|
|
Stack Overflow | 31,963 rep | 53774 |
|
|
Meta Stack Overflow | 1,363 rep | 316 |
|
|
Code Review | 919 rep | 39 |
|
|
Programmers | 582 rep | 39 |
|
|
Super User | 534 rep | 27 |
0 Votes Cast
This user has not cast any votes