OK, I really can't PHP, or SQL. Fixed SQL queries and parameter binding, among many other things. Needs more error checking