I am trying execute a mySQL query from $wpdb->get_results but nothing returns while it works fine from phpAdmin and returns.

  $sql=" select SQL_CALC_FOUND_ROWS ref_id,
        case status
        when 0 then 'Waiting'
        when 1 then 'Invited'
        when 2 then 'Joined'
        when 3 then 'OPTOUT'
        else 'Unknow'
     end as Status,
     CONCAT(fname,' ',lname) as Name,
     from ".$wpdb->base_prefix."waitingList where status!=-1 and ref_id=".$current_user->id
$invitess =$wpdb->get_results($sql);

Invites does not return any thing while phpAdmin

Please help me

Read more here: mySQL query wroks from phpAdmin and returns rows but $wpdb->get_results dones return anything


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , , , , ,

Wordpress related questions and answers: