Gone are the days when I did something like this: WHERE something = '".$query->real_escape_string($your_unsafe_value_here)."'
So I've made the move to prepared statements, but I'm a little confused on how to debug some of my queries now. Here's an example PDO prepared statement that uses named placeholders. I've taken this from the online php manual:
/* Execute a prepared statement by binding PHP variables */
$calories = 150;
$colour = 'red';
$sth = $dbh->prepare('SELECT name, colour, calories
FROM fruit
WHERE calories < :calories AND colour = :colour');
$sth->bindParam(':calories', $calories, PDO::PARAM_INT);
$sth->bindParam(':colour', $colour, PDO::PARAM_STR, 12);
$sth->execute();
If I need to do a quick test on a query, how do I run something like this in phpmyadmin? (...or is there another mysql GUI that can easily handle these types of queries?)