# Phase 5B — mysqlnd Compatibility Patch

## Problem fixed

Some cPanel PHP 7.4 environments enable `mysqli` but do not enable the `mysqlnd` driver. In that configuration, PHP throws:

```text
Call to undefined function mysqli_stmt_get_result()
```

## Fix

This patch adds a compatibility helper:

```text
/inc/db_result.php
```

The app and installer now use:

```php
db_stmt_fetch_assoc($stmt);
db_stmt_fetch_all($stmt);
```

These helpers use `mysqli_stmt_get_result()` only when it exists. When `mysqlnd` is not available, they fall back to `mysqli_stmt_bind_result()` so prepared statement reads still work.

## Files changed

```text
/inc/bootstrap.php
/install/install.php
/inc/db_result.php
/inc/preflight.php
/functions/pos_staff.php
/functions/pos_tables.php
/functions/pos_menu.php
/functions/pos_checks.php
/functions/pos_devices.php
/functions/pos_printers.php
/functions/pos_kds.php
/functions/pos_sync.php
/install/install_lib.php
```

## Install note

Upload this package over the previous Phase 5A files. Keep your existing `inc/config.local.php` if you already created it.
