0 votes
1 view
in SQL by (6.1k points)

What is a parameterized query, and what would be an example of such a query be in the PHP and MySQL?

1 Answer

0 votes
by (12.7k points)
edited ago by

A parameterized query is a type of query in which the placeholders are used for the parameters and the parameter values are supplied at the execution time.

Why we use the Parameterized Query

  1. The most important reason to use the parameterized query is to avoid all the SQL injection attacks.
  2. Secondly, the parameterized query takes care of the scenario where sql query might fail for e.g. inserting of O'Baily in a field. Parameterized query handles such type of queries without forcing you to replace single quotes with double single quotes.

If you want to learn more about SQLCheck out this SQL training and certification program by Intellipaat.

Related questions

0 votes
1 answer
asked Jul 18, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
asked Jul 5, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...