• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get dynamic url slug in route file error

#1
i'm getting the dynamic url slugs in route file from database.

but i'm getting error

here is the code

require_once(BASEPATH.'database/DB'.EXT);
$db =& DB();
$query = $db->get( 'your_table_name' );
$result = $query->result();
foreach($result as $row) {
   $route[ $row->slug ] = $row->controller_name;
}

Fatal error: require_once(): Failed opening required '/home/cmihub/public_html/real-estate/system/database/DBEXT' (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/cmihub/public_html/real-estate/application/config/routes.php on line 56
Reply

#2
EXT is no long a constant in the newer CI versions, use the ext name.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#3
can you send any example
Reply

#4
Just change this

PHP Code:
require_once(BASEPATH.'database/DB'.EXT); 

to this

PHP Code:
require_once(BASEPATH.'database/DB.php'); 
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.