Added php SQL functions, javascipt functions