This board is the new home for david63's extensions.

All of the extensions hosted here will need to be treated as a new install as there is no migration from the original ones to these, and furthermore, no support will be given to migrating to any of these extensions from previous versions.


Due to the selfishness of certain board members it has become necessary to apply a limit of how many downloads each member can make before making a donation. Once a donation has been made then you will have unlimited downloads.

[3.3.0] Forum Subs

Fully working extensions
doublejay
Member
Member
Posts: 4
Joined: November 2023

Re: [3.3.0] Forum Subs

#61

Post by doublejay »

So the problem is the extensions code is not DB agnostic.

If you use mySQL everything is fine, because mysqli_query will return a mysqli_result class. This class has a "num_rows" property:
https://www.php.net/manual/en/class.mysqli-result.php

But, if you use PostgreSQL as backend, pg_query is used by phpBBs DB driver, which returns a PgSql\Result class. This class has no "num_rows" property (it has no properties at all):
https://www.php.net/manual/en/class.pgsql-result.php

Thus, trying to access "num_rows" on a Postgres result will issue a Warning.

Edit: For Postgres, you would have to use pg_num_rows($result) instead of $result->num_rows. But of course then it will fail for everything that is not postgres.I don't know what the "phpBB way" of solving this is, but the root cause seems to be clear.

User avatar
devspace
Owner
Owner
Posts: 279
Joined: October 2022

Re: [3.3.0] Forum Subs

#62

Post by devspace »

Do you have this problem with PHP 8.1?

Whilst some/most of phpBB will work with PHP 8.2 the upper PHP version is still at 8.1

This may well be a bug in phpBB's dbal with PHP 8.2 and needs to be reported in phpBB's bug tracker.

doublejay
Member
Member
Posts: 4
Joined: November 2023

Re: [3.3.0] Forum Subs

#63

Post by doublejay »

No, it's because you are using code that only works with MySQL.

Please read my last post again. Accessing a "num_rows" property only works with MySQL. With PostgreSQL you get a completely different result class, one that has no such property.

Your code is not DB agnostic. It has nothing to do with PHP 8.2 or phpBB dbal.