Welcome Guest, Not a member yet? Register   Sign In
Routing via Database?
#2

[eluser]Adam Griffiths[/eluser]
I did this for an old CMS I made.

Code:
// BEGIN FRESH DYNAMIC ROUTING

$connection = mysql_connect('localhost', 'user', 'pass');
mysql_select_db('db_name', $connection);

$query = mysql_query('SELECT * FROM routes');

while($result = mysql_fetch_array($query))
{
    $route[$result['fake_route']] = $result['real_route'];
}

mysql_close($connection);

// END FRESH DYNAMIC ROUTING

It's pretty simple, all you need inside the table is an id, the "fake" route (the first route in th CI route), and the real route (the part after the = sign).

Hopefully I made sense.


Messages In This Thread
Routing via Database? - by El Forum - 12-28-2008, 05:08 PM
Routing via Database? - by El Forum - 12-28-2008, 07:10 PM
Routing via Database? - by El Forum - 12-28-2008, 07:13 PM
Routing via Database? - by El Forum - 12-29-2008, 02:23 AM
Routing via Database? - by El Forum - 12-29-2008, 02:49 AM
Routing via Database? - by El Forum - 12-29-2008, 03:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB