Here is one way adding the 'slug' to the db
title "Title of the Blog Post"
text_blog "blah ...
// **security check of GET var omitted for brevity**
$sql = "select id from blog_table where slug = '. $_GET['post_id'] .'"
Another way is to maintain a mapper between titles and ids as say a PHP array in a static file.
$blog_posts = "title-of-the-blog-post";
$key = array_search($_GET['post_id'], $blog_posts)
added array_search advice
array_search — Searches the array for a given value and returns the corresponding key if successful
I believe there is a way of getting Apache to do the lookup vs a static file too, but I did not use it.
ps here is a similar discussion from earlier this week
What does everyone else do?
Moved from PHP forum? huh?