Page MenuHomeDevCentral

Use associative arrays by default for MySQLi results
ClosedPublic

Authored by dereckson on Jun 22 2023, 21:40.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 20:10
Unknown Object (File)
Sat, Dec 21, 19:50
Unknown Object (File)
Mon, Dec 9, 21:37
Unknown Object (File)
Thu, Dec 5, 12:44
Unknown Object (File)
Thu, Dec 5, 12:43
Unknown Object (File)
Thu, Dec 5, 06:10
Unknown Object (File)
Thu, Dec 5, 06:10
Unknown Object (File)
Thu, Nov 28, 15:11
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