0

I'm certain there must be a tutorial from this somewhere, I just can't seem to find the right phrase to Google to find what I want.

I'm self-teaching PHP and MySQL. I'm trying to make a MySQL driven blog website (as a way to self teach).

I have a MySQL table like such;

| id | title | content | url |
| 0 | Blog Post 1 | *long string of text* | blog-post-1 |

I know how to load the title and content columns into a page via php and mySQL, but how can I get it so that when I visit www.myurl.com/blog-post-1 it loads a the html/php template I have made from the MySQL entry rather than a page on site?

chris85
  • 23,846
  • 7
  • 34
  • 51
user6227447
  • 51
  • 1
  • 3
  • It is called pretty URLs, you use a rewrite to map `/blog-post-(\d+)` to your page maybe `index.php?id=$1`. Then use `$_GET['id']` to pull your record. – chris85 Aug 28 '16 at 16:44
  • 1
    Possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) – chris85 Aug 28 '16 at 16:47

0 Answers0