This is pretty old, but As of PHP5. Beginners be aware that:
1 - The $value in the protect function will only exist in the block, so calling the protect function to clean the sql query will do nothing unless you plan to do the query in the block itself.
Didn't watch whole thing, but at least up to here I can update you guys that much xD. Enjoy php/mysql