Thank you for the hint. Here is our adjustment:
if(is_numeric($mobile_current_id) && $mobile_current_id >= 1 && $mobile_current_id <= 9){
$mobilemeta = $wpdb->get_row("SELECT <code>theme_template</code>,<code>redirect</code> FROM <code>".TABLE_MOBILEMETA."</code> WHERE <code>mobile_id</code>=$mobile_current_id");
if($mobilemeta->redirect) {
header("Location: $mobilemeta->redirect");
exit;
}
return $mobilemeta->theme_template;
}
return null;