This is a read-only copy of the MariaDB Knowledgebase generated on 2024-12-22. For the latest, interactive version please visit https://mariadb.com/kb/.

SQL - PHP SYMFONY 4 - QUOTE

Hello,

I want to interrogate my BD which includes a Json field.

When I test my request in phpmyadmin (sql) everything works but in php (symfony 4) I have a quote problem I think.

Here is my request

$sql = " SELECT * FROM myTable WHERE user_id = :userId AND JSON_CONTAINS(roles, '["ROLE_FOO"]') ";

Thanks

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.