• Hey, I’ve been working on some PHP for a C# app I’m working on. The app has the user type in their username and password and then queries the server to see if they have permissions to do stuff. I got the C# part to work, and the PHP works… sort of. It won’t find users. I’ve tried get_user_by(‘login’, $username), username_exists($username), and even SQL queries, but it’s not working. Hopefully you can help me out. This is what I’ve got (couldn’t get code to work here):

    https://pastebin.com/AbWSuq26

Viewing 3 replies - 16 through 18 (of 18 total)
  • popper

    (@julialasarte)

    I meant trying querying mysql directly, though, without any interference from wordpress at all, phpmyadmin, ssh, whatever you prefer. Just to make sure this is a wordpress issue. Other than that, maybe the wordpress cache is acting up?

    Thread Starter snoozbuster

    (@snoozbuster)

    I don’t have any idea if phpMyAdmin or anything of the sort is installed, and the guy who owns the site is away and will be for the next month or so, although he probably wouldn’t have any idea what I’m talking about anyway. I might try SSHing in, but I’m not sure how or where to start.

    Also, I tried globalizing $wpdb but that didn’t help either.

    Strangely enough I was not able to make this similar code to work.

    global $wpdb;
    $buyer_id = $row->uid; //echoed 3
    $u = get_user_by('id',$buyer_id);
    
    echo 'u:'.$u->email;

    WP User object is not generated at all.

    After reading codex, using public example, reading pluggable.php,
    I decided to post it here.

    WP is 3.4.1

    any clues?

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘get_user_by not returning any users.’ is closed to new replies.