Well, I Developed a website in php but now I was advised by a colleague to use the pdo php class instead of the traditional crud to avoid sql injection.
But I never use pdo and study about pdo. I want to ask if its possible after studying pdo and see how it works change the crud of my website easily and quickly, or adapting now pdo to my website I have to change the very structure and logic of the site? Like my example below, its possible pass this to pdo, and then the site continue to operate icual without more changes besides the sql? And I used my_real_escape_string, because I thought that was enough to control the sql injection.
My style of crud that I´m ussing:
<?php
require('connect.php');
$query = "SELECT * FROM users WHERE id != ''";
$exeqr = mysql_query($query) or die(mysql_error());
if(!empty($_GET['id']))
{
$uid = mysql_real_escape_string($_GET['id']);
$querytwo = "SELECT * FROM users WHERE id ='$uid'";
$exeqrtwo = mysql_query($querytwo) or die(mysql_error());
$assoc = mysql_fetch_assoc($exqrtwo);
echo'<h1>'.$assoc['name'].'</h1>';
echo'<p>'.$assoc['email'].'</p>';
}