Title: Pulling Data from wp_users
Last modified: June 22, 2017

---

# Pulling Data from wp_users

 *  Resolved [ilink](https://wordpress.org/support/users/ilink/)
 * (@ilink)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/pulling-data-from-wp_users/)
 * I have modified my sql database, wp_user table.
    I have added several lines to
   it.
 * I run a very small business where I setup game servers, graphic design, and so
   on. I have dumbed down my wordpress to basically just be used for woocommerce,
   and the back end stuff helps manage accounts.
 * on “my-account” php, I have edited to show my clients business name, status of
   their services, links to their site and web mail, last/next payment, and notes
   from me. All of which are on that wp_user table.
 * These work, I have tested them. My issue is because wordpress doesnt use sessions,
   and I for the life of me cannot find it on my theme, I have no way of identifying
   each client, than pulling their respective data.
 * Ive tried a handful of plugins, and read a ton of articles, None of which are
   working for me.
 * any help or suggestions would be appreciated.
 * ![](https://i0.wp.com/i.imgur.com/DR4NcBs.jpg)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [ilink](https://wordpress.org/support/users/ilink/)
 * (@ilink)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/pulling-data-from-wp_users/#post-9250151)
 *     ```
       <?php 	$conn = new mysqli('HOSTNAME', 'USERNAME', 'PASSWORD', 'DATABASE');
           $query = "SELECT Auth FROM wps_users WHERE ID = " . (int)$_SESSION;
           $result = mysqli_query($conn, $query);
   
       switch($result->fetch_assoc()['Auth']) {
           case 0:
               echo '<span style="color:#5b5b5b;text-align:center;">You do not have a service, Get one <a href=/shop.php?>HERE</a></span>';
               break;
           case 1:
               echo '<span style="color:#09bbe2;text-align:center;">Preparing..</span>';
               break;
           case 2:
               echo '<span style="color:#42f45c;text-align:center;">Online!</span>';
               break;
           case 3:
               echo '<span style="color:#d80e04;text-align:center;">Suspended</span>';
               break;
       } ?>
       ```
   
 * Attempted to pull data in a stand alone string.
    works fine normally, just not
   with WP.
    -  This reply was modified 8 years, 11 months ago by [ilink](https://wordpress.org/support/users/ilink/).
 *  Thread Starter [ilink](https://wordpress.org/support/users/ilink/)
 * (@ilink)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/pulling-data-from-wp_users/#post-9262574)
 * Bump

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Pulling Data from wp_users’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 1 participant
 * Last reply from: [ilink](https://wordpress.org/support/users/ilink/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/pulling-data-from-wp_users/#post-9262574)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
