Support » Developing with WordPress » Pulling Data from wp_users

  • Resolved ilink


    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?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>';
        case 1:
            echo '<span style="color:#09bbe2;text-align:center;">Preparing..</span>';
        case 2:
            echo '<span style="color:#42f45c;text-align:center;">Online!</span>';
        case 3:
            echo '<span style="color:#d80e04;text-align:center;">Suspended</span>';
    } ?>

    Attempted to pull data in a stand alone string.
    works fine normally, just not with WP.

    • This reply was modified 2 years, 4 months ago by ilink.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pulling Data from wp_users’ is closed to new replies.