fix: replace deprecated mysql_* with mysqli_* in upgrade scripts#771
fix: replace deprecated mysql_* with mysqli_* in upgrade scripts#771Frankli9986 wants to merge 1 commit into
Conversation
…ipts Fixes opencats#572 where demo content installation fails on PHP 7+ because upgrade scripts still used removed mysql_* functions. Changes: - mysql_real_escape_string() -> mysqli_real_escape_string() - mysql_fetch_row() -> mysqli_fetch_row() - Added global \ where needed for mysqli context
|
Hi @Frankli9986, thanks for looking into this. This looks closely related to and partly overlapping with my existing PR #765. From what I can see, this PR fixes the same obsolete I think it would be better to consolidate the work in one PR rather than having two separate fixes for the same issue. You are very welcome to join #765 and submit suggestions there, especially because there are small differences between both approaches that may still be useful to discuss or incorporate. I also started a discussion in the comments of #765 about a few open questions before merging, including whether changing previous migrations is the right approach. I would be happy if you joined that discussion as well. |
Problem
Fixes #572
When installing OpenCATS with demo content on PHP 7+, the installation fails because database upgrade scripts still use the deprecated
mysql_*functions, which were removed in PHP 7.0.Changes
mysql_real_escape_string()→mysqli_real_escape_string()(2 occurrences)mysql_fetch_row()→mysqli_fetch_row()(1 occurrence)global \;where needed to ensure the mysqli connection resource is available in the upgrade script context.Files Modified
modules/install/Schema.phpTesting
mysql_*function calls remain in the codebase (only these 3 were found in upgrade script strings).mysqli_*usage already present inmodules/install/ajax/ui.php.Related Issue