• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dbprefix does not do what I want it to do.

#1
[eluser]John_Betong[/eluser]
 
I decided to try and use Active Record throughout a new project and the following error occurred:
Code:
// database.php configuration
      $db['default']['database'] = 'johnsjokes';
      $db['default']['dbprefix'] = 'XXXXX_';


   // my_model.php ActiveRecord call
      $total = $this->db->count_all('articles');


      A Database Error Occurred
      Error Number: 1146
      Table 'johnsjokes.XXXXX_articles' doesn't exist
      SELECT COUNT(*) AS `numrows` FROM `XXXXX_articles`
 
I would have thought that the XXXXX_ should be prefixing the database name and not the table.
 
Is this a bug?
 
 
 

#2
[eluser]pistolPete[/eluser]
[quote author="John_Betong" date="1251459600"]I would have thought that the XXXXX_ should be prefixing the database name and not the table.[/quote]

Read the user guide: http://ellislab.com/codeigniter/user-gui...ation.html
Quote:dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.

#3
[eluser]John_Betong[/eluser]
[quote author="pistolPete" date="1251459787"][quote author="John_Betong" date="1251459600"]I would have thought that the XXXXX_ should be prefixing the database name and not the table.[/quote]

Read the user guide: http://ellislab.com/codeigniter/user-gui...ation.html
Quote:dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
[/quote]
 
Many thanks for the clarification.
 
Maybe it should be renamed to tableprefix so that I will not get confused with the prefix that my host uses for all database names.
 
 
 


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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