7
Rod,
I took a deeper look at this, specifically the 2.5 driver, but the results should be relevant anyway.
Using $this->conn instead of the $GLOBAL variable works fine, just as expected. The use of the global connection variable should probably be eliminated.
There are issues with getFieldName() and getFieldType() as both never leave the first column no matter what is specified in the offset. These also have a lot of fluff from the converter program.
getFiledName is easy to fix:
returnĀ $result->fetch_field_direct($offset)->name;
getFieldType is more complicated, but the statement that is in there now is so complex, it would be difficult to maintain. However there is a much bigger issue for future plans. The actual returns in the mysql connector are not clearly defined, and the mysqli functions in PHP returns numeric rather than string data. PDO, as far as I can tell doesn't support that kind of metadata except in an "experimental" method. There does not seem to be any standardization, making the data very driver dependent.
This method doesn't seem to be actively used in the XOOPS world. I have not been able to find a real world test case, just the test I wrote for testing this connector. We should take a serious look at what value it adds to have this method, and consider eliminating it in 2.6 as it seems to be pointless overhead.
I've got a cleaned up version of your 2.5.6 connector. It removes all the $GLOBAL references, and substitutes a big switch to provide names for all of the documented types. (Not exactly elegant, but it doesn't take an hour to figure out what it does.) I would like to get it to you for review; drop me a private email or suggest some other route.
It would be nice to get some support for prepared statements into 2.6 and PDO would be SO COOL! It would also be great if we could get a non-deprecated connector into 2.5.7.
Thanks for all your work!
-Richard