anchor.diff:  			if (state != null && !state.equals("all") && !state.equals("null"))
   			{
   				sql2 = "SELECT * FROM users_total ORDER BY total LIMIT 20";
  -				sql3 = "SELECT * FROM users_products_total WHERE pid IN (SELECT pid FROM products_totals ORDER BY total LIMIT 10)";
  +				sql3 = "SELECT * FROM users_products_total AS upt WHERE upt.pid IN (SELECT pt.pid FROM products_total AS pt ORDER BY pt.total LIMIT 10)";
   			}
   			else
   			{
  -				sql2 = "SELECT * FROM users_total WHERE uid IN (SELECT uid FROM users WHERE state = " + state + ") ORDER BY total LIMIT 20";
  -				sql3 =  "SELECT * FROM users_products_total WHERE uid IN (SELECT uid FROM users WHERE state = " + state + ") AND pid IN (SELECT pid FROM products_totals ORDER BY total LIMIT 10)";
  +				sql2 = "SELECT * FROM users_total AS ut WHERE ut.uid IN (SELECT u.uid FROM users AS u WHERE u.state = '" + state + "') ORDER BY ut.total LIMIT 20";
  +				sql3 =  "SELECT * FROM users_products_total AS upt WHERE upt.uid IN (SELECT u.uid FROM users u WHERE u.state = '" + state + "') AND upt.pid IN (SELECT pt.pid FROM products_totals AS pt ORDER BY pt.total LIMIT 10)";
   			}
   		}
   		else
  
positive.code: 	rs1 = stmt1.executeQuery(sql1); //1 = pid, 2 = total
  	rs2 = stmt2.executeQuery(sql2); //1 = uid OR state, 2 = total
  	rs3 = stmt3.executeQuery(sql3);	//1 = uid OR state, 2 = pid, 3 = total
  	
  	/*
  	conn.commit();
  
negative.code: 			if (state != null && !state.equals("all") && !state.equals("null"))
  			{
  				sql2 = "SELECT uid, total FROM users_categories_total ORDER BY total LIMIT 20";
  				sql3 = "SELECT * FROM users_products_total AS upt WHERE upt.pid IN (SELECT p.pid FROM products AS p WHERE p.cid = " + category + ") ORDER BY upt.total LIMIT 10";
  			}
  			else
  			{
  				sql2 = "SELECT * FROM users_categories_total AS uct WHERE uct.uid IN (SELECT u.uid FROM users AS u WHERE u.state = '" + state + "') ORDER BY uct.total LIMIT 20";
  				sql3 = "SELECT * FROM users_products_total AS upt WHERE upt.uid IN (SELECT u.uid FROM users WHERE u.state = '" + state + "') AND upt.pid in (SELECT p.pid FROM products AS p WHERE p.cid = " + category + ") ORDER BY upt.total LIMIT 20";
  			}
  		}
  	}
  