Solve SQL errors

When the name had an ' it returns an error