phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

PHP7 migration: mysqli


 
Search this topic... | Search Knowledge Base (KB)... | Search Box
Register or Login to Post    Index » Knowledge Base (KB)  Previous TopicPrint TopicNext Topic
Author Message
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 130



PostPosted: Wed Feb 20, 2019 10:17 pm 
Post subject: PHP7 migration: mysqli

Second part of the "phpBB2 to PHP7 migration" guide.
This one is for mysqli, the API using mysqlnd (mysql native driver) that replaced the old mysql API.


Introduced in PHP5.0.0, mysqli is an API that brings better mysql integration in PHP: better performances, more tools, and object-oriented.
Its only issue is that... It's not used in PHP. I don't even know the history of PHP's "mysql3" vs "mysql4/5" driver, but anyway...

This procedure will replace your current mysql layer, instead of adding another one. This is mildly simpler.

COPY (prepare a backup)
Code:
db/mysql.php

TO
Code:
db/mysql.bak.php


DOWNLOAD FILE (I know, I just made that up)
Code:
https://github.com/IntegraMOD/IntegraMOD151/blob/6d672f28350c3bc3d02f2edcd71210c1dabe6f03/IM150/includes/db/mysqli.php

UPLOAD FILE TO
Code:
db/mysql.php


OPEN (the file you just downloaded
Code:
db/mysql.php

FIND
Code:
   define("SQL_LAYER","mysqli");

REPLACE WITH
Code:
   define("SQL_LAYER","mysql");


Note: this SQL class supports caching, but it shouldn't break if your forum doesn't use caching. Please tell me if it does. It also includes sql_escape which is a function a lot of mod use.
Back to top
Display posts from previous:   
Register or Login to Post    Index » Knowledge Base (KB)  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0243 seconds using 15 queries. (SQL 0.0024 Parse 0.0008 Other 0.0211)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo