Php Query Result To Array Python Definition