Jump to content

SQL Injection


otuatail

Recommended Posts

The -- only has meaning in a query when it is outside of a quoted string. When used inside of a quoted string they are treated as part of the string. mysql_real_escape_string will prevent sql injection for string data (kind of why it is called what it is.)

 

If you have numeric data (which would not be enclosed in quotes in the query) you need to validate that it is numeric or cast it as a numeric data type to prevent sql injection.

Link to comment
https://forums.phpfreaks.com/topic/172015-sql-injection/#findComment-907048
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.