I need to read/write to the wp_users table

I want to use the data in the wp_users table to display directly in pages on my site but when I try to access this in PHP all I get is a single record and not the entire list of users. I’m using exactly the same code as in a page accessing another database (not in WP) & simply changing the connection parameters (username, password etc). This code works perfectly, but when I substitute the wp_users table I just get the last record in the table. It seems like there is some special protection for the wp table? How can I overcome this please?