note_addAdd Question
mode_editWrite Article
notificationsNotifications
0

Why is using a mysql prepared statement more secure than using the common escape functions in PHP Server Side Scripting Language?

Asked by: Zareen Gole
rate_review
mode_edit
Edit
rss_feed
report
Report

Logged in user is eligible to submit a report! Login

Available Answers: 1

Trishulank Kumar (Biotechnologist Hardware Business Strategy Tableau Contract Management) From: Raipur/India
"

An important point that I think people here are missing is that with a database that supports parameterized queries, there is no 'escaping' to worry about. The database engine doesn't combine the bound variables into the SQL statement and then parse the whole thing; The bound variables are kept separate and never parsed as a generic SQL statement.

"

That's where the security and speed comes from. The database engine knows the placeholder contains data only, so it is never parsed as a full SQL statement. The speedup comes when you prepare a statement once and then execute it many times; the canonical example being inserting multiple records into the same table. In this case, the database engine needs to parse, optimize, etc. only once.

"

Now, one gotcha is with database abstraction libraries. They sometimes fake it by just inserting the bound variables into the SQL statement with the proper escaping. Still, that is better than doing it yourself.

"
thumb_up10
chatComment
rss_feedFollow
reportReport

Logged in user is eligible to submit a report! Login

Logged in user is eligible to submit a comment! Login



More Interesting Questions


#Question# How to php pow (PHP Scripting Language)

#Answer#

Roma Kamra answered


1
2
Source: Code Grepper

#Question# How to laravel migration table softdeletes (PHP Scripting Language)

#Answer#

pkejfoa Kam answered


1
Source: Code Grepper

#Question# How to php grab month from date (PHP Scripting Language)

#Answer#

Shrikumar Dora answered


1
Source: Code Grepper

#Question# How to php if negative make positive (PHP Scripting Language)

#Answer#

dcrco Prabha answered


1
2
3
4
5
6
Source: Code Grepper

#Question# How to tinyinteger laravel +size (PHP Scripting Language)

#Answer#

Colonna Sophia answered


1
Source: Code Grepper

#Question# How to check if string contains substring php 8 (PHP Scripting Language)

#Answer#

Damon phdmj answered


1
Source: Code Grepper

#Question# How to put woocommerce orders on pending payment automatically (PHP Scripting Language)

#Answer#

Ahsan Sonali answered


1
2
3
4
5
6
7
8
9
10
Source: Code Grepper

#Question# How to php obfuscate email (PHP Scripting Language)

#Answer#

Avi Levi answered


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
35
36
37
38
Source: Code Grepper

#Question# How to php serialize() (PHP Scripting Language)

#Answer#

Emerson rdwaxri answered


1
2
3
4
Source: Code Grepper

#Question# How to php remove file (PHP Scripting Language)

#Answer#

icywc Deepak answered


1
2
3
Source: Code Grepper

#Question# How to password_hash() php 7 (PHP Scripting Language)

#Answer#

hniteyd Emil answered


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Source: Code Grepper

#Question# How to associate laravel (PHP Scripting Language)

#Answer#

Jamie Lokesh answered


1
2
3
4
5
6
7
8
9
10
11
12
Source: Code Grepper

#Question# How to symfony creating custom form types (PHP Scripting Language)

#Answer#

McBreazy xsyvbwmc Shreya answered


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Source: Code Grepper

#Question# How to default time of session in php (PHP Scripting Language)

#Answer#

Kavisha Leon answered


1
2
Source: Code Grepper

#Question# How to laravel join (PHP Scripting Language)

#Answer#

Swathi Azam answered


1
2
3
4
5
6
7
8
9
Source: Code Grepper

#Question# How to laravel token authentication (PHP Scripting Language)

#Answer#

Raju lvodwh Prasantkumarwat answered


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Source: Code Grepper

#Question# How to php artisan drop table (PHP Scripting Language)

#Answer#

Schuppe Alex answered


1
Source: Code Grepper

#Question# How to laravel array_pluck (PHP Scripting Language)

#Answer#

Kayal fbdu Ivy answered


1
2
3
Source: Code Grepper

#Question# How to php foreach index (PHP Scripting Language)

#Answer#

Muhil SEM answered


1
2
Source: Code Grepper

#Question# How to laravel websockets onclose (PHP Scripting Language)

#Answer#

Sarvashay Patil answered


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Source: Code Grepper

#Question# How to php concat variable and string (PHP Scripting Language)

#Answer#

Agendra Wagle answered


1
2
3
4
5
Source: Code Grepper

#Question# How to php constructor (PHP Scripting Language)

#Answer#

Anil Date answered


1
Source: Code Grepper

#Question# How to find element in arrat php (PHP Scripting Language)

#Answer#

Chakravarty Igor answered


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Source: Code Grepper

#Question# How to alter row in table laravel (PHP Scripting Language)

#Answer#

Avinash zjytlreo answered


1
2
3
4
5
Source: Code Grepper

#Question# How to how to get a variable from php to javascript (PHP Scripting Language)

#Answer#

Graham fepdt answered


1
2
3
4
5
6
7
8
9
10
Source: Code Grepper

#Question# How to orwherebetween laravel (PHP Scripting Language)

#Answer#

Tanveer Ali answered


1
2
3
Source: Code Grepper

#Question# How to php now (PHP Scripting Language)

#Answer#

Amos aktpuowu Ujjwal answered


1
2
3
4
Source: Code Grepper

#Question# How to how to link a external modules using href in php (PHP Scripting Language)

#Answer#

crfbmt Dhara answered


1
Source: Code Grepper

#Question# How to bcrypt laravel (PHP Scripting Language)

#Answer#

Mohammed psofcpwi answered


1
Source: Code Grepper

#Question# How to php is variable a number (PHP Scripting Language)

#Answer#

Paola maukgiv answered


1
2
3
Source: Code Grepper

#Question# How to print array in php (PHP Scripting Language)

#Answer#

Cyrus Shaman answered


1
Source: Code Grepper

#Question# How to laravel get file size uploaded (PHP Scripting Language)

#Answer#

Waqar Kazi answered


1
Source: Code Grepper

#Question# How to how to get match date and month in php (PHP Scripting Language)

#Answer#

Bibi Aguilar answered


1
Source: Code Grepper

#Question# How to laravel query order by relation (PHP Scripting Language)

#Answer#

rntgwk Shingare answered


1
2
3
Source: Code Grepper

#Question# How to pasar datetime a string php (PHP Scripting Language)

#Answer#

Mounica ikze answered


1
2
3
4
5
Source: Code Grepper

#Question# How to laravel transaction query not working when multiple db connection (PHP Scripting Language)

#Answer#

qkfucqck Holt answered


1
Source: Code Grepper

#Question# How to allow shortocde the_excerept (PHP Scripting Language)

#Answer#

Lop ggfscf Menna answered


1
2
3
Source: Code Grepper

#Question# How to how to store value in session using javascript in php (PHP Scripting Language)

#Answer#

otgv Mathew answered


1
2
Source: Code Grepper

#Question# How to str_shuffle in php (PHP Scripting Language)

#Answer#

zqcs Clement answered


1
Source: Code Grepper

#Question# How to php can't upload gif (PHP Scripting Language)

#Answer#

Belle ecwscf Sanskriti answered


1
2
3
4
5
Source: Code Grepper

#Question# How to laravel multiple paginate (PHP Scripting Language)

#Answer#

In dckfo Ravindra answered


1
2
3
4
5
6
Source: Code Grepper

#Question# How to query builder laravel (PHP Scripting Language)

#Answer#

ngdlzr Jinna answered


1
2
3
4
5
6
Source: Code Grepper

#Question# How to wordpress get user by id (PHP Scripting Language)

#Answer#

Lucy jrhua answered


1
Source: Code Grepper

#Question# How to dropdown in crud application YII (PHP Scripting Language)

#Answer#

Aqeel yrbjozp answered


1
2
3
4
5
Source: Code Grepper

#Question# How to base64 decode in php (PHP Scripting Language)

#Answer#

Funds neqmtkv Sagar answered


1
Source: Code Grepper

#Question# How to laravel get last record (PHP Scripting Language)

#Answer#

Pharma Shiv answered


1
Source: Code Grepper

#Question# How to update php (PHP Scripting Language)

#Answer#

Jahan Smarty answered


1
2
3
4
5
6
7
Source: Code Grepper

#Question# How to laravel skip a loop if error (PHP Scripting Language)

#Answer#

nmfkeb Saied answered


1
2
3
4
5
6
7
8
Source: Code Grepper

#Question# How to php foreach array (PHP Scripting Language)

#Answer#

Chaudhary sdorw answered


1
2
3
4
Source: Code Grepper

#Question# How to codeigniter redirect (PHP Scripting Language)

#Answer#

Sarwar oniyjvci Lloyd answered


1
2
Source: Code Grepper