What and How possible injection in PHP and mysql?

Answer Posted / dinesh g

What is Injection?
When a user is inserting any value into the text box, we
store that in a variable and place it in a query. If the
user also types any query within the text box our mysql will
run the query.

ex :

INSERT INTO students (name) VALUES ('Dinesh'); DROP TABLE
Students;

Here the user types his name as Dinesh also he write the
next query to drop the table. so this table is dropped if it
is present.

TO avoid it we use addslashes() else
mysql_real_escape_string() methods to escape from the users
query.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I learn laravel without php?

583


can we swap two different string using php for example:-- before swapping:-- 1 string :-hello friend, 2 string :-my dear, after swapping that strings will be: 1.hello dear, 2.my friend.

3083


What is meant by public, private, protected, static and final scopes?

539


Explain the difference between $message and $$message?

561


What is difference between echo and print in php?

503






What are the 5 types of data?

571


What is == and === in php?

513


What is regex in html?

519


How do you count numbers in php?

516


Is php a cms?

541


What is input sanitization in php?

558


What is the difference between $name and $$name?

529


What is purpose of @ in Php?

666


How cookies are transported from browsers to servers?

505


Which cryptographic functions in php returns the longest hash value?

583