[eluser]Pygon[/eluser]
[quote author="Michael Wales" date="1204599848"]Yeah - my explanation above isn't the best implementation, just the easiest to understand for newer users.
Personally, I extended the Router class to allow SQL queries in the route. I always place this route as the first, so it will perform the SQL query defined the route and if it returns a row, it will follow that route.
An example:
Code:
// domain.com/walesmd
// SQL: SELECT id FROM users WHERE username = walesmd
// End Route: user/profile/36
$route["sql[SELECT id FROM users WHERE username = $1]"] = "user/profile/$1";
[/quote]
Rather clean implementation, though i'd hate querying the db on every hit (even when it's not needed).