Welcome Guest, Not a member yet? Register   Sign In
Pb with select_max() with ibase
#1

[eluser]bkarat[/eluser]
Hi !

I have the following stmt in my code:

$this->db->select_max('FINSHORT');

I get the following error while running:

Fatal error: Call to undefined method CI_DB_ibase_driver:Confusedelect_max() in........

I am using Firebird. Is it a known pb or I am using an old driver? Where do I get the latest ibase drivers?

Thanks in advance

With regards,
Bala
#2

[eluser]pistolPete[/eluser]
What CI version are you using?
Did you get the firebird drivers from here?
The function select_max should be in ./system/database/DB_active_rec.php.
#3

[eluser]bkarat[/eluser]
Hi !

Thank you very much for yr reply.

Yes, we had downloaded the ibase files from the same location.

We are using the latest codeigniter download (1.7.0).

Now we remember that we had a problem with the downloaded DB_active_rec.php. The system was always giving a problem. Then one of our programmers replaced this with an earlier version and found it was working. I just now confirmed that select_max is not available in this file.

But then I tried to replace the file with the latest one and we are getting the following error:

Fatal error: Call to undefined method CI_DB_ibase_driver::_protect_identifiers() in ......\system\database\DB_active_rec.php on line 429

Any help would be appreciated.

With regards,
Bala
#4

[eluser]pistolPete[/eluser]
Function _protect_identifiers is located in ./system/database/DB_driver.php.
There is a README.txt in DB_ibase.zip:
Quote:Installation Instructions:

1. Copy DB_driver.php to BASE_CODEIGNITER_DIRECTORY/system/database/
2. Create directory BASE_CODEIGNITER_DIRECTORY/system/database/drivers/ibase
3. Copy ibase*.php to BASE_CODEIGNITER_DIRECTORY/system/database/drivers/ibase/

The packaged DB_driver.php does not contain the function _protect_identifiers.
protect_identifiers was added in CI 1.6.0, so you are using a version of the file which is pretty old.
#5

[eluser]bkarat[/eluser]
Hi !

I am sorry, I am confused.

Where do I get the latest DB_driver.php from? From codeIgniter folder only?

I copied the DB_driver.php and DB_active_rec.php from codeIgniter folder and was still getting another problem. Just now I downloaded 1.7.1 version and copied all the database files to my project (the ibase file remains the same). When I run the project, I get the following error:

Fatal error: Call to undefined method CI_DB_ibase_driver::_db_set_charset() in C:\wamp\www\Payroll21\system\database\DB_driver.php on line 171

Pl help.

With best regards,
Bala
#6

[eluser]pistolPete[/eluser]
I am confused as well because of your use of strange abbreviations Undecided
Quote:Where do I get the latest DB_driver.php from?
http://dev.ellislab.com/svn/CodeIgniter/.../database/

The ibase drivers were developed some time ago, since then the database layer has changed somehow. That's why these drivers do not really work anymore... You have to adjust the ibase drivers.
Look e.g. at the mysql driver and add any missing functions to the ibase driver.

For example, this function is missing in your driver:
Code:
function db_set_charset($charset, $collation)
#7

[eluser]bkarat[/eluser]
Hi !

Thanks a lot.

So, it may be a better bet to use only standard queries (not the codeIgniter style) with Firebird, for the time being?

With regards,
Bala
#8

[eluser]pistolPete[/eluser]
Well it shouldn't be too hard for you to create those missing functions.
Just look at an existing driver and write an equivalent to it.

Using the database abstraction layer CI provides you gain much portability of your application in the event of having to change your database server.

I even think it looks "cleaner" to me.
#9

[eluser]bkarat[/eluser]
Thanks. Definitely I will try this.

With best regards,
Bala




Theme © iAndrew 2016 - Forum software by © MyBB