{"id":979,"date":"2011-06-08T02:39:17","date_gmt":"2011-06-08T07:39:17","guid":{"rendered":"http:\/\/www.dpriver.com\/blog\/?page_id=979"},"modified":"2011-12-22T04:20:31","modified_gmt":"2011-12-22T09:20:31","slug":"parse-the-values-and-field-names-in-where-clause","status":"publish","type":"page","link":"https:\/\/www.dpriver.com\/blog\/list-of-demos-illustrate-how-to-use-general-sql-parser\/parse-the-values-and-field-names-in-where-clause\/","title":{"rendered":"Parse the values and field names in where clause"},"content":{"rendered":"

Parse the values and field names in where\/having clause, or check that the user has specified specific columns in the where clause, this information can be used to code a parameterized query then protect\/detect SQL injection.<\/p>\n

the sample SQL statement that needed to be parsed was:<\/p>\n

    \r\nSELECT firstname,\r\n       lastname,\r\n       age\r\nFROM   Clients\r\nWHERE  State = \"CA\"\r\n       AND City = \"Hollywood\" \r\n<\/pre>\nThe result you may wanted to achieve was similar to this:<\/p>\n\r\ncolumn: State\r\nOperator: =\r\nvalue: \"CA\"\r\n\r\ncolumn: City\r\nOperator: =\r\nvalue: \"Hollywood\"\r\n<\/pre>\nDownload this demo: C# demo<\/a>, Java demo<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Parse the values and field names in where\/having clause, or check that the user has specified specific columns in the where clause, this information can be used to code a parameterized query then protect\/detect SQL injection. the sample SQL statement that needed to be parsed was: SELECT firstname, lastname, age FROM Clients WHERE State = “CA” AND City = “Hollywood” The result you may wanted to achieve was similar to this: column: State Operator: = value: “CA” column: City Operator: = value: “Hollywood” Download this demo: C# demo, Java demo<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":235,"menu_order":120,"comment_status":"closed","ping_status":"open","template":"gsp_feature_page_tt.php","meta":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"yoast_head":"\nHelp you to make better use of General SQL Parser<\/title>\n\n\n\n\n\n\n\n\n\n\n\n