Rewrote product and products functions, fixed errors for mysql_query constructs