What does 'assoc' mean for fetchAll() in SQL?

Asked 1 years ago, Updated 1 years ago, 275 views

When running SQL statements directly, the Cookbook says:
What does this 'assoc' mean?

$sql='select * from Users';
$results=$connection->execute($sql)->fetchAll('assoc');

cakephp

2022-12-05 02:27

1 Answers

There was a description in the manual.
Similar to the PDO,
Returned if 'assoc' is specified It seems that you will be able to retrieve values from the result set by column name.

CakePHP Manual


2022-12-05 04:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.