How to write a SQL Safe Query using quoteInto() method magento 2?

Using a SQL quoteInto() method, Write a Query using Magento standard way with SQL Safe quoted value.

Return Type: quoteInto() always returns a string with SQL-safe quoted value placed into the original text.

quoteInto() method used in the direct SQL query for a safe quote with SQL conditions.

Base Definition:

  • Use of quoteInto() method will be mostly seen inside Direct SQL query with conditional statements.

Quotes a value and places into a piece of text at a placeholder. The placeholder is a question-mark; all placeholders will be replaced with the quoted value.

Example for delete entry from the core_config_data table with Direct query delete(),

Using the above way, You can use quoteInto() method into text string with Safe SQL query.