I have to say that it happens regularly to me that I tend to miss or use the wrong escaping of strings when for example handling html parameters (get, post) using them in php and sending them to mysql.
I am pretty sure that this happens not only to me but of course to many other people as well. And it's not only about functionality and bugs but it's a strong security issue as well.
While I write this I should be a little bit more aware of the problem but it might be very well possible that there are already quite advanced language concepts which are developed in order to avoid these mistakes in general.
So this is not a question about code but rather in general about how should programming of html/php/mysql be done so that these mistakes simply cannot occur as easy as they do right now.