Question

PHP Why is it important to use the mysqli_real_escape_string() function? After what kind of queries would...

PHP

Why is it important to use the mysqli_real_escape_string() function?

After what kind of queries would you use the mysqli_num_rows() function?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.)

Using these functions makes your site less vulnerable to SQL injection attacks, where an attacker puts SQL syntax into a form field to compromise your site. mysqli_real_escape_string()"escapes" special characters so that MySQL interprets them as literal string characters rather than operators in the query.

These functions only affect characters that are important to SQL commands, and will not affect legitimate input, while foiling nefarious users.

2.)

After select queries.

The mysqli_num_rows() function is an inbuilt function in PHP which is used to return the number of rows present in the result set. It is generally used to check if data is present in the database or not. To use this function, it is mandatory to first set up the connection with the MySQL database.

Syntax:

mysqli_num_rows ( $result );

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

Add a comment
Know the answer?
Add Answer to:
PHP Why is it important to use the mysqli_real_escape_string() function? After what kind of queries would...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT