Page MenuHomeDevCentral

Use associative arrays by default for MySQLi results
ClosedPublic

Authored by dereckson on Jun 22 2023, 21:40.
Tags
None
Referenced Files
F3327815: D3207.id8204.diff
Mon, Jul 8, 20:47
F3327626: D3207.id8202.diff
Mon, Jul 8, 18:09
F3323323: D3207.id8202.diff
Sun, Jul 7, 23:55
Unknown Object (File)
Sun, Jul 7, 05:53
Unknown Object (File)
Fri, Jul 5, 22:00
Unknown Object (File)
Fri, Jul 5, 17:08
Unknown Object (File)
Thu, Jul 4, 05:37
Unknown Object (File)
Wed, Jul 3, 04: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