Search code examples
phpmysqlrowuniquecreation

Unique page for each row in MySQL


I have a table in MySQL. I want to create a new file in my directory, to each row will have a unique page. The only problem, is that many rows are related to the same user, (same ID). I want to make sure users will only see their pages. Any idea how can I do that?


Solution

  • You can use .htaccess file and virtual address like:
    www.site.com/128.html
    htaccess code for up address is:

    RewriteRule (.*)\.html$ index.php?user_id=$1 [L]
    

    You can check user id with $_GET['user_id'] variable.