When I do (in laravel):
1,
]);
It says:
From what I can see it all comes down to mysql
being unable to deal with named parameters.
mysqli::prepare:
This parameter can include one or more parameter markers in the SQL statement by embedding question mark (?) characters at the appropriate positions.
pdo::prepare:
You must include a unique parameter marker for each value you wish to pass in to the statement when you call PDOStatement::execute(). You cannot use a named parameter marker of the same name more than once in a prepared statement, unless emulation mode is on.
Laravel has emulation mode disabled by default. One can enable it in config/database.php
by adding 'options' => [PDO::ATTR_EMULATE_PREPARES => TRUE]
to connection settings. That way you will get the same result as in pure php. Not sure that's a good idea, though.