Learn how to write SQL directly

Asked 1 years ago, Updated 1 years ago, 310 views

Hello.

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-11-18 23:16

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-11-18 23:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.