Here's how it happened:
1. Tom Riddle, disguised as a student named Tom Riddle, spoke Parseltongue (the language of snakes) to the basilisk statue in the Chamber of Secrets, opening the entrance.
2. Harry Potter, also able to speak Parseltongue, later spoke to the statue as well, but he wasn't opening the Chamber. He was actually attempting to close it.
So, while Harry could speak Parseltongue and interacted with the statue, he never used it to open the Chamber. It was Tom Riddle who did that.