i am developing a Search Engine by PHP, which search any Code Block i have posts and store, like MSDN
and My website will store ALL type PROGRAMMING LANGUAGES ( PHP, c#, JS...) ( Estimates about 10.000 Code )

And bestway to implement that? how to Avoid SQL Injection if I store my Code block in Database.
if dont choose Database to Store, what is another way to do???