Page MenuHomeDevCentral

Use associative arrays by default for MySQLi results
ClosedPublic

Authored by dereckson on Jun 22 2023, 21:40.
Tags
None
Referenced Files
F12351554: D3207.id8202.diff
Tue, Oct 28, 00:33
F12345705: D3207.diff
Mon, Oct 27, 06:33
Unknown Object (File)
Sun, Oct 26, 08:41
Unknown Object (File)
Sat, Oct 25, 16:47
Unknown Object (File)
Fri, Oct 24, 18:53
Unknown Object (File)
Thu, Oct 23, 13:03
Unknown Object (File)
Tue, Oct 21, 04:32
Unknown Object (File)
Mon, Oct 20, 16: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