Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument '2' passed to select() is expected to be of type array, string given #1125

Open
stefankummer opened this issue Sep 12, 2024 · 3 comments

Comments

@stefankummer
Copy link

Information

  • Version of Medoo: 2.1.12
  • Version of PHP: 8.2.22
  • Type of Database: MySQL
  • System: Linux

Describe the Problem
Argument '2' passed to select() is expected to be of type array, string given

@catfan
Copy link
Owner

catfan commented Sep 13, 2024

You are passing a string to the second select() parameter.

Please read the documentation. https://medoo.in/api/select.

@stefankummer
Copy link
Author

Hi, according the docs that i"ve read, to select an entire column :
$data = $database->select("account", "user_name");
Second argument is a string.

@catfan
Copy link
Owner

catfan commented Sep 13, 2024

@stefankummer Sorry, my mistake. However, it should work. It's on the test case.

public function testSelectSingleColumn($type)
{
$this->setType($type);
$this->database->select("account", "name");
$this->assertQuery(
<<<EOD
SELECT "name"
FROM "account"
EOD,
$this->database->queryString
);
}

Please provide the full code you called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants