[eluser]Vince Stross[/eluser]
For me it always boils down to validating every $_POST. For instance, I always check the one condition that always seems to be there that would make it impossible for someone to get anywhere from fishing IDs. I only have database IDs in the URL in the backoffice area where you can usually assume the admin of the site has no reason to want to break something.
Otherwise, follow the lead of the blogging platforms using slugs and such to refer to a database row using an alphanumeric, URL friendly value. Code igniter has a function that will convert a string value for instance, "Mike's Home Page" into "mikes_home_page" for you to save as a seperate column in your database. This way you can lookup on that value (if you have a large table you may want to index this column as well) when using a URL to find a database row. This also permits much more search friendly sites because you can add the ".html" on the end for links, etc.
Have Fun!