Closed mikewcaldwell closed 2 years ago
That's part of 1.9, but it has not been released. You can try to extract the new query logic from there, if you have some free time :)
Other approaches:
data->$
and send $.cookie
as a parameterThat's good to hear, thanks for the info and quick response! I will go ahead and close this issue.
I'm currently setting up Q2A to work with an existing user database where my user sessions database (built on node.js:express-session) uses JSON to store information about the session in a database.
When trying to read this data, I would like to be able to query JSON inside my SQL query (simple example follows, code is in qa-external-users.php::qa_get_logged_in_user()). The below query works when called directly through mysql.
'SELECT data->'$.cookie' FROM sessions WHERE session_id=#;'
However, in qa-db.php::qa_db_apply_sub, ^, $ and # are reserved with no way to escape them (as far as I can tell).
Would it be better to use mysqli bind_param and the built-in support for prepared statements? https://www.php.net/manual/en/mysqli-stmt.bind-param.php
Thanks.