Page MenuHomeDevCentral

Use associative arrays by default for MySQLi results
ClosedPublic

Authored by dereckson on Jun 22 2023, 21:40.
Tags
None
Referenced Files
F3303351: D3207.diff
Wed, Jul 3, 04:14
Unknown Object (File)
Tue, Jul 2, 03:46
Unknown Object (File)
Fri, Jun 28, 16:28
Unknown Object (File)
Thu, Jun 27, 10:46
Unknown Object (File)
Sun, Jun 23, 21:02
Unknown Object (File)
Sun, Jun 23, 12:12
Unknown Object (File)
Sat, Jun 22, 19:36
Unknown Object (File)
Sat, Jun 22, 15:44
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