1

enter image description here

I have build a query which then will be used as subquery. So it is needed to be transfromed to sql. When I call toSql method it shows me such sql query

"select * from `product_variant_values` where 
(`option_id` = ? and `value_id` = ?)
 or (`option_id` = ? and `value_id` = ?) 
or (`option_id` = ? and `value_id` = ?)"

But I want so that instead of ? signs there will be real arguments. How can I do this?

2 Answers 2

2

You cannot obtain the SQL with the prepared values filled. You may use getBindings for obtaining the values and replacing it in your query.

Sign up to request clarification or add additional context in comments.

1 Comment

Very helpful. I know setBindings, but did not think about getBindings. Now i can prepend bindings of subquery with main query and everything works.
0

just a cheating way.

You can edit your query to get a syntax error. You can see your query with all arguments

1 Comment

If I needed to see the query I would use a debugger. But I need to use it as subquery with all bindings. So it is not an answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.