Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Argument #2 ($arg) must be passed by reference, value given #222

Copy link
Copy link
@Nightmare

Description

@Nightmare
Issue body actions

I'm probably missing something out, but the query is simple and the row is correctly inserted into the db.

I installed it with composer ezsql/ezsql on windows, xampp, php 8.1.4

the, double, error

Warning: ezsql\Database\ez_mysqli::ezsql\Database{closure}(): Argument #2 ($arg) must be passed by reference, value given in C:\xampp\htdocs\vendor\ezsql\ezsql\lib\Database\ez_mysqli.php on line 307

Warning: ezsql\Database\ez_mysqli::ezsql\Database{closure}(): Argument #2 ($arg) must be passed by reference, value given in C:\xampp\htdocs\vendor\ezsql\ezsql\lib\Database\ez_mysqli.php on line 307

use ezsql\Config;
use ezsql\Database\ez_mysqli;

$dsn_path_user	= 'root';
$password	= '';
$database	= 'database';
$other_settings	= '';

$settings = new Config('mysqli', [$dsn_path_user, $password, $database, $other_settings]);

$db = new ez_mysqli($settings);

$db->prepareOn(); // with and without prepareOn

$values = [];
$values['name'] = "test name";
$values['status'] = '1';
$name = 'test name';
$status = 1;
$db->insert('meetings', $values);

i also tried, same error, and new row in the db is inserted.

$db->insert('meetings', ['name' => $name, 'status' => $status]);

or

$db->insert('meetings', ['visitor_name' => "$name", 'status' => "$status"]);

if I do simple query without shortcut it works without errors

$db->query("INSERT INTO meetings (visitor_name, status) VALUES ('$name', 1)");

Thank you

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    error-bugIssues causing application termination.Issues causing application termination.warning-bugIssues not causing scripts/routines to die/fail.Issues not causing scripts/routines to die/fail.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.