Page MenuHomeDevCentral

Use associative arrays by default for MySQLi results
ClosedPublic

Authored by dereckson on Jun 22 2023, 21:40.
Tags
None
Referenced Files
F24987561: D3207.id8204.diff
Mon, Mar 23, 14:30
F24975916: D3207.id.diff
Sun, Mar 22, 16:30
Unknown Object (File)
Sun, Mar 22, 14:54
Unknown Object (File)
Sun, Mar 22, 01:27
Unknown Object (File)
Thu, Mar 19, 20:34
Unknown Object (File)
Tue, Mar 17, 15:33
Unknown Object (File)
Tue, Mar 17, 14:11
Unknown Object (File)
Tue, Mar 17, 08:20
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