TroyGrosfield.com TroyGrosfield.com

Posts Tagged ‘sql’

Headline

Preventing an SQL Injection Attack in PHP

Author
by Troy Grosfield
Date
December 15th, 2010
Category
Developer
Story

I recently was asked to fix some bugs on a particular website.  While looking through the state of the code I noticed the site was susceptible to an SQL injection attack. Issue The site is taking the user input and directly inserting it into the SQL statement without escaping. PHP Code Issue $sql = “SELECT … read more

Tags
Comments
No Comments »
Headline

Find All Non-Distinct Rows Using SQL

Author
by Troy Grosfield
Date
August 21st, 2010
Category
Developer
Story

I want to be able to find all non-distinct rows based on multiple columns, but not using all columns, and see how many occurrences there are. I would like to find all rows for people that have the same first_name, last_name, and middle_initial. Data Table Name: my_table id first_name last_name middle_initial 1 Billy Bob J … read more

Tags
Comments
No Comments »