fixed php variables and table names