Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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 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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...