miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

MySQL 5 / PHP5 compatability Mod

Author desertkoala
#1 | Posted: 8 Jan 2006 21:44 
I have succesfully modified miniBB 2.0 RC5 to work with MYSQL 5.0.11 using PHP 5.1.1 on Apache 2.0.55.

Would the board administrator please start a new forum called (MYSQL 5) so that I can start posting and sharing necessary modifications?

Author Lukasz_DR
#2 | Posted: 8 Jan 2006 22:42 
Can you share your mod ? Where it is available?

Author Lukasz_DR
#3 | Posted: 8 Jan 2006 22:57 
Sorry I didn't read whole your post :) I am forum administrator and my server admin changed MySQL from 3 to 5 version. and now my Forum doesn't work. I am desperate need your mod. Can you send me your mod? on dr650rs[at] please!! :>

Author desertkoala
#4 | Posted: 9 Jan 2006 01:17 
I'm waiting for the moderator to open a new forum before I start posting information.

Suffice to say, your administrator should rollback to a pre mySQL 5 version. The mod involves some dramatic changes to the PHP commands. Specifically, the following files change:

1. setup_mysql.php
- all of the functions now use an external include to reference global variables and setup the mySQL mysqli_select for a valid $conn connection
2. all of the mysql_select have changed to mysqli_select
3. added a con.php as referenced in #1
4. added a con-private.php to store the internal mySQL 5.x login
5. modifed table (minibbtable_topics)
- topic_last_post_time default value is '0000-00-00 00:00:00'
6. modified the installer _install.php to include #3

While it installs and runs. There are two outstanding issues that only the software programmers can address:

1. function db_simpleSelect
- having trouble changing $result=mysqli_query to something 5.x friendly.
- I am currently using mysqli_use_result but it has some issues
2. function db_calcAmount
- having trouble changing $amount=mysqli_result to something 5.x friendly.
- I am currently using:
$result=mysqli_num_rows($conn, 'select count(*) from '.$tbName.' where '.$tbKey.'='.$tbVal);
if($tbKey2=='') $tbKey2=$tbKey;
mysqli_query($conn, 'update '.$setName.' set '.$setField.'='."'".$amount."'".' where '.$tbKey2.'='.$tbVal);
return $amount;

Author Team
#5 | Posted: 9 Jan 2006 08:38 | Edited by: Team 
We will not open new forum for that, since we are keeping the transparent structure of all forums, but we are really interested in that topic, so we'll put it as Sticky for now.

Your remarks sound really clear for us even at this point, but still not clear, why this needs to be a mod rather than a plugin. Isn't it possible to make all changes only within setup_mysql.php? So it could be some kind of mysql5-addon, and users will be able just to replace that file and make it run on mysql5?

Author desertkoala
#6 | Posted: 10 Jan 2006 11:58 
This following link, supplied by Paul, will give you the code necessary to install/run MySQL 5 and PHP 5.

Included in the ZIP file is a README.TXT

FAQ to follow shortly.

Author Team
#7 | Posted: 10 Jan 2006 13:05 
Thank you. Hopefully everybody having questions about this mod can post them here.

Author marsbar
Associated Member
#8 | Posted: 3 Feb 2006 10:41 | Edited by: marsbar 
Hi desertkoala and Team,

Q1. Can the MySQL 5 Mod (or is it a plugin?) be applied to an existing miniBB installation, or can it only be applied to a brand new installation?

Step 1 in the readme.txt says to create a backup, which suggests the mod can be used for existing installations, but the statement at the end of the file (which reads "TESTED FOR BRAND NEW INSTALLATIONS") got me wondering.

My web host have announced plans to upgrade existing MySQL databases from 4.x to 5. I hope my miniBB will not die as a result of the inevitable database upgrade!

Q2. If the mod is for existing miniBB installations, besides applying this mod, is there anything else I must do to enable my miniBB to run under MySQL 5?

Q3. Is there a reason for the MySQL 5 Mod/plugin not being listed in/made available from the official miniBB Downloads area?

Thanks in anticipation,

Author Team
#9 | Posted: 6 Feb 2006 08:03 
1. Most probably it can be applied to any installation beginning from RC5 release (until we haven't changed setup_mysql.php file).

2. As far as we know, mysql 5 itself does not contain anything very specific for miniBB, and after database upgrade, it should work normally. So most probably, you don't need to do anything.

3. miniBB developes find this solution as a temporary, for those who really need to run the board on very new mysql & php releases; in the future, we are planning to make our own compatibility with these releases.

desertkoala's solution is more oriented on PHP5 release, with built-in mysqli functions instead of mysql (f.e., mysqli_query, mysqli_connect etc.)

Author marsbar
Associated Member
#10 | Posted: 6 Feb 2006 10:16 | Edited by: marsbar 
Many thanks, Team, for your most reassuring reply (particularly #2) - it is a relief to learn that moving to MySQL 5 will not kill my miniBB. :-)

Author Team
#11 | Posted: 6 Feb 2006 11:55 
Anyway, we HIGHLY recommend to make all possible backups before moving onto that.

Author desertkoala
#12 | Posted: 28 Feb 2006 17:19 
I agree with Team. It should have been posted as a PHP5 compatability mod. The MySQL portion is trivial in terms of compatabilty. It is PHP5 that required some thinking and tinkering.

Author Paul
Lead Developer
#13 | Posted: 5 Apr 2006 13:31 
I have just installed PHP5 on my local development server, and would to share these impressions with everyone.

First of all - latest version of miniBB works with PHP5 without any problems! I have turned on default mySQL module in php.ini (uncommented extension=php_mysql.dll - by default, it's turned off) and copied libmysql.dll to Windows/System32 folder. In combination with other settings, this all allowed my old good Apache 1.3.33 successfully run PHP5 with no troubles.

I must say that some addons and probably language packs will cause execution of miniBB because of incorrect syntax of using php tags like <?php ... ?> From old times, we have marks like <? ... ?> left in many scripts. By default, PHP5 configuration allows only <?php ... ?> and <script> tags, so every script containing <?...?> tags will not execute, and can cause the general execution, if it's being included. Overall, main miniBB core and all common (latest) addons contains <?php...?> tags, and everything is working just fine.

Also, global arrays like HTTP_POST_VARS (also as for GET and COOKIE) are not available anymore. So, miniBB 1.x will not work, but 2.x will.

I have not tested mysqli yet, but this is what you can get from the solution above...

Additionally, miniBB 2 RC6 is on the way, and we hope this will be really latest release of the beta series. We are working now on XHTML compliant templates, and this is the main goal we want to dedicate all further development, incl. renovation of addons, CSS skins and language packs.

Author Samuel Vignoli
#14 | Posted: 1 Feb 2008 18:23 | Edited by: Samuel Vignoli 

Do I have to do something to upgrade my database to 5.0?
(MiniBB 2.1c+PHP4+Apache1.3+Mysql5.0)

Sorry to ask this but this topic is a little old =)

ps> From manual: "As about PHP or database version, we recommend to use ONLY FINAL and STABLE versions of these products.

Before installing miniBB, be sure you have PHP installed on your server, and you have mySQL host, login and password information which you'll need to put into configuration file.

Is OK to use PHP 5.2.X, Apache 2.2.X and MySQL 5.0.X?

Thank you,

Author Paul
Lead Developer
#15 | Posted: 4 Feb 2008 04:13 
It is completely safe to upgrade mySQL to version 5.0 - all miniBB statements are very basic and should be compatible with any even future version of mySQL... the mod mentioned in this topic just provides some kind of miniBB working with mySQLite and I think most users should not use it for compatibility with newest mySQL versions.

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / MySQL 5 / PHP5 compatability Mod Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB