Firebird PHP Test Script ibtest

Created by: Lester Caine, Last modification: 28 May 2025 (11:28 BST)

So back to basics. I have this working on PHP7.3 with FB3, but switching to FB5 gives a '502 Bad Gateway', now to build a table of checks to see where we are and perhaps try switching to pdo. The current demo site has been taken down currently but should be live again fairly soon.

PHP Version Driver FB3 FB4 FB5 PDO OODriver
7.3.33 Unlisted Working   502 Bad Gateway    
7.4.33 5.0.1 Working
Update OK but ? on one test
  Working
Update OK but ? on one test
   
8.3.19 3.0.1 Failed on Create Table   Failed on Create Table    
8.4.5 5.0.1 Not tested   Working nicely Working nicely I've got most things working, but updating character fields is being difficult.
             

The drop table problem has been wrangled under control and I don't even need to drop and remake the connection, simply ensure that the active transaction is closed. On the generic driver I just needed to start with a defined transaction and not rely on the default one, perhaps not helped by using ibase_commit_ret rather than ibase_commit, but a simple ibase_rollback allows the drop table script to run. On the pdo driver these are replaced by beginTransaction and  then inTransaction can be used to trigger a rollBack before running the drop take query. As I am on a roll with both of these drivers I've not gone back to check all this out on the OO driver, but I will take the time to do that just to complete the picture, hence leaving the todo section below.

Moving on to the next step was a little fun, but in reality it is working nicely. 128 bit numbers ... just require using the bcmath extension to hold the values in php, and I can happily push values into both INT128 and DECFLOAT(34) fields in Firebird 5. This flags up the next niggle, which is that these fields are being reported as VARCHAR so that needs to be looked at as to where that is picked up. My playing with ibWebAdmin dovetails in with this as a number of areas need extending in that to cope with the newer data types and also the changes to the system table structures. In parallel with this, the pdo driver is not returning field types at all, simply numeric values. By using ADOdb in the main code, this is less of a problem as that provides easy management of table structures transparently across all database engines, which was a point I'd highlighted early in the development of PDO in PHP. I'm not quite sure the best way to progress here, but extending PDO to handle metadata transparently is perhaps an outstanding problem.

I need to restore my own code management system so that the development of these scripts can be tracked, but for the moment I'll just save then as text files here. - Includes checks for DECFLOAT(16), DECFLOAT(34) and INT128
ibtest php Script is providing more problems, so a copy can be downloaded from ibtest.php Script File and ibtest_pdo.php Script File ... just strip the .script bit which stops my website trying to process it ...
The taxt pages here are also available versioned and that is something I would like to be able to bookmark without the website crawlers scraping every version on the system. The note below is from an earlier version of the page just for reference ...

TODO:

I had initially missed the subtle difference between php-firebird which is the generic driver sourced from php itself, and firebird-php,  which mlazdans is hosting on github. It is an OO style interface, and I've probably spent more time playing than I should have, but I do now have crib sheets for the various classes and have a firebirdtest.php script that is almost fully functional. Still got the problem of dropping the temporary table at the end, which I've got working in a second script, but adding that at the end of the first script is not working. Just how do you drop the existing connection in PDO? close should work in the OO driver, but I'm still dancing around update 'PHP_TEST set c = \'PHP test\'' which is crashing the script, and I'm having my usual problems with finding any error messages on the development stack.