Something doesn't look quite right about this Yahoo hack. Yahoo doesn't store MySQL passwords in PHP source code like that. Maybe he pulled these out of something else and wrote that file himself as an odd way to show he got the passwords?
Also, the apparent SQL injection is on a yahoo.net domain which Yahoo uses for untrusted third-party stuff mostly. The fact that the error seems to be from ASP is further evidence that this is very likely some third-party hosted app that doesn't actually have much to do with Yahoo and likely poses no danger to Yahoo users beyond the ones using this particular third-party service, whatever it is.
I'm pretty sure the code shown is the "hacker"'s code, for demo's sake. That said, the server address redacted out doesn't appear to be a Yahoo domain from what I can see. That tells me that it's a third-party that was broken into.
Might mean nothing. Article says the attacker had access to 12 databases, so maybe it's a mix of different platforms. Still, the 2 screenshots really don't corroborate one another.
Also, the apparent SQL injection is on a yahoo.net domain which Yahoo uses for untrusted third-party stuff mostly. The fact that the error seems to be from ASP is further evidence that this is very likely some third-party hosted app that doesn't actually have much to do with Yahoo and likely poses no danger to Yahoo users beyond the ones using this particular third-party service, whatever it is.