Page MenuHomeDevCentral

Use associative arrays by default for MySQLi results
ClosedPublic

Authored by dereckson on Jun 22 2023, 21:40.
Tags
None
Referenced Files
F3767726: D3207.id8204.diff
Sat, Nov 23, 03:07
F3767659: D3207.id8203.diff
Sat, Nov 23, 02:37
F3767076: D3207.diff
Fri, Nov 22, 22:18
Unknown Object (File)
Wed, Nov 20, 13:58
Unknown Object (File)
Wed, Nov 20, 13:42
Unknown Object (File)
Wed, Nov 13, 19:43
Unknown Object (File)
Wed, Nov 13, 19:13
Unknown Object (File)
Wed, Nov 13, 05:14
Subscribers
None

Details

Summary

The MySQLi extension supports three different fetch modes
to represent a row as an array:

  • associative keys
  • numeric keys
  • both of them

This change switches from the default "both of them"
to associative keys to encourage more expressive code,
and ease code maintenance.

The queryScalar method will seek the first key of the array accordingly.

Test Plan

Unit tests added and updated accordingly for MySQLi

Diff Detail

Repository
rKERUALD Keruald libraries development repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable