I'm taking over someone else's PHP project, and when looking at the code, I've found many of these:
$query = "INSERT INTO `".$_POST["tablename"]."` SET `cust_id`='".$_POST["cust_id"]."' , `cust_email`='".$_POST["cust_email"]."' ,`".$_POST["field"]."`='".mysql_real_escape_string($_POST["value"])."'";
mysql_query($select);
Now, as far as I know, using mysql_ functions is not a good thing, due to safety and due to, well, they're deprecated... So I guess these all have to be changed to mysqli_ or PDO? But what about the $_POST["things"]? He only escaped one POST variable, why not the others?
Edit: After marking this post as duplicate: I know this is a common question, and has been asked before. It is because it is such common knowledge, that I am asking this specifically. Perhaps I was missing something...