Update regenerate-post-permalink.php

Very preliminary changes, need to sanitize date properly and test SQL query