1. fixed parameter referencing in p_get_row - was incorrect
2. added general query with parameters