I get an Undefined offset: 1 message from this query below. Do not understand why I get it. The echo results in correct data.
echo $url_slug ; $Exploded_slug = explode($user->ID.'--',$url_slug); print_r($Exploded_slug );
$url_slug result: 4--106
print_r($Exploded_slug ) result: Array (  => 4--106 )
$query = "SELECT comments FROM wp_rdp_winners WHERE id = $Exploded_slug"; $comments = $wpdb->get_var($query);
The above query is empty. ID 4 has no comments and does not exist in table. If this means that the ID = 4 has not a comments field, then how can I skip this whit an if statement?