Fork me on GitHub



Make donations with PayPal!
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00

GitHub Twitter

Learn XOOPS Core

Local Support


XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 4 6 admin adslight Android AntiHarvesting AntiSpam API Apple Battlefield Blocks Bootstrap Captcha cell chronolabs Clicks Cloud content CĂN demo download Dresses facebook Fat floor Gateway giải Google Guide herre Home Honeypot html5 Human HỘ IP iPhone jQuery Language Law Legal List log Loss module modules Monster new newbb news nhiệt NHÀ online PARK Payment phone PHP Plugin Prevention profile project Protector publisher RESIDENCE responsive review Rights Room security Sentry Signatures Signed site Smartphone Smarty Smoking Solution Spam stem Studio support tag tdmcreate The Theme themes tháp User userlog weight xoops Xortify XPayment ZendFramework

New Users

Registering user

# 139409


Welcome to XOOPS!


News archives

MySQLi Connectors for Xoops 2.5.6 and 2.6

Posted by redheadedrod on 2013/8/3 17:50:00 (4564 reads) | Posted on XOOPS
MySQLi connectors are now available for 2.5.6 and 2.6. These connectors should be considered as Beta and should not be used on a production server at this time.

These have been designed as a drop in addition to the current MySQL connector.

The current MySQL connector used by Xoops allows Xoops to talk to the MySQL database. This older connector has been around since MySQL version 3 and not only does not support new features of MySQL 4 and 5 but is now officially Depreciated in the latest release of PHP. For now this doesn't mean much to most but means that the current MySQL connector will no longer work in the future.

MySQLi was released to take advantage of the features in the newest versions of MySQL and as such is the direct replacement for the older MySQL connector. I used a script that converts old MySQL code to MySQLi compatible code as my base and went from there. Although I still have some questions for a core developer about some of the code the script created it does run without any known errors.

The use of these connectors is very simple. You download the version of mysqlidatabase.php that you need and copy it to your class/database folder. You then modify the database type in your secure.php file from MySQL to MySQLi and you are on your way.

Both of these connectors can be found in the SVN.

Connector for 2.5.6 MySQLi and for 2.6 MySQLi.

Please direct bug reports to the following thread:

Printer friendly page Send this story to a friend Create a PDF from the article
Bookmark Me
Bookmark to Google Plus
The comments are owned by the author. We aren't responsible for their content.

ok i did made that on 3 differetn sites, no problems mysql version 5.5.33

1. But in admin panel there is no info about your mysql version anymore ?
Old connector has no that problem

2.Must we do any conversion in mysql ? or is just adding that file and modifying secure.php ok ?
Published: 2013/8/4 12:27 • Updated: 2013/8/4 12:27
Thanks Rodney for your hard work on this! This is awesome!

I hope that after sufficient testing, if everything works correctly, the Core Team will consider including it in future releases.

I am very short on time, but I'll see if I can do some testing.

But this is very exciting - it's time to leave our old "mysql" extension behind us and move to "mysqli"
Published: 2013/8/5 1:07 • Updated: 2013/8/5 1:07
Thank you for testing!. It will be easier to track bugs in the forum link I posted but I will try to answer these here.

1. What version of xoops are you using? And can you point out where you are finding this information? I will look into it and see why it isn't working. Should be an easy fix. I have found some items are returned slightly different under MySQLi than they are under the older MySQL and something may need some tweaking.

2. In theory just adding the file and modifying the secure.php should be all that is required. This will be a good test to see in practice how well this works. As long as there are no bugs in the connector the core and core included modules should work without modification unless they themselves have bugs that don't show with the older MySQL connector.

In reality some modules will need to be updated to make sure they use the database connector fully. When a developer mixes using the xoops based connector and direct PHP code to access the older MySQL connector the module will break. It should be relatively simple however to fix those modules. Hopefully not too many newer modules will have this issue.

Also, as mentioned Prepared Statements, stored procedures and transactions are not included in this connector.

Another item to be aware of:
Transactions can not be used with tables using the MyISAM engine which most if not all xoops tables are. Transactions require the table to be using InnoDB engine. This is a limitation of the MySQL database and can not be over ridden by the connector.

Mamba, other than any bugs that come up I only expect some possible restructuring of some of the code for beautification reasons.
Published: 2013/8/5 5:18 • Updated: 2013/8/5 5:26
I mention this further in the thread but the admin class needs to be modified and a function added to the database connectors. I will work this out in the next couple days and post the results. This should be done before 2.5.7 is released.
Published: 2013/8/5 19:25 • Updated: 2013/8/5 19:25
Required patches to Module Admin Class and MySQL connector have been placed in the SVN. These patches will be required to allow MySQLi and future new connectors to properly display the Version of the server.

Still working on the MySQLi connector updates that are needed from testing done so far. Please watch the above mentioned thread for more details.

Published: 2013/8/11 20:01 • Updated: 2013/8/11 20:01