So i'm trying to implement some custom doing a SELECT to a table i created.
I'm using the following:
global $wpdb;
$fivesdrafts = $wpdb->get_results("SELECT * FROM wpjk_vuln WHERE IDuser = " . um_profile_id());
foreach ( $fivesdrafts as $fivesdraft )
{
echo $fivesdraft->IDprogram;
}
When i open the page where the IDprogram should be displayed it isn't, not sure why.
BUT, if i add an echo with the query, bellow the code:
global $wpdb;
echo "SELECT * FROM wpjk_vuln WHERE IDuser = " . um_profile_id();
$fivesdrafts = $wpdb->get_results("SELECT * FROM wpjk_vuln WHERE IDuser = " . um_profile_id());
foreach ( $fivesdrafts as $fivesdraft )
{
echo $fivesdraft->IDprogram;
}
The page will display the IDprogram, it's just strange. I already hardcoded the um_profile_id() value and it happens the same thing.