Re: Malicious SQL
| From: | Gabe | Date: | Wed, 07 Jul 2004 16:16:43 +0000 |
| Subject: | Re: Malicious SQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189881@lists.php.net to get a copy of this message | ||
Gabe wrote:
Can someone help me understand how people are able to use SQL maliciously if you don't protect against it in PHP? For example, I've written a very simple search SQL statement that takes the value of a variable for the search criteria ( from a webpage form ). I don't understand how someone could enter an SQL statement that could be malicious. Here's the SQL statement that I run once I have the search criteria stored in $strCriteria: SELECT autoQuesID, fldQuesTitle, fldBody FROM tblFAQ_Question WHERE (blnHidden = FALSE AND ((fldBody LIKE '%$strCriteria%') OR (fldQuesTitle LIKE '%$strCriteria%'))); I know in general that protecting against someone entering SQL is a must . So I guess I'm just wondering if anyone has any real-world experience with how people can take advantage of SQL and forms. Thanks! GabeThat was very helpful. Thanks!