variable_get with prefix It's there a chance to retrieve all key/value, stored in variable table, that have a prefix, using variable_get()?
e.g: variable_get("prefix_*")

Or I have to use db_select('variable')?
I'm afraid not, variable_get() is a very simple function that just returns an item in the global $conf array, there's no method for searching built in.

You could write your own variable_select() function though, and you wouldn't have to go into the database as the entire variable table is loaded into $conf at the start of the page build. It might go something like this:

function variable_select($prefix) {
  $found = array();

  global $conf;
  foreach ($conf as $key =&gt; $value) {
    if (strpos($key, $prefix) === 0) {
      $found[$key] = $value;
    }
  }

  return empty($found) ? FALSE : $found;
}


I'm sure that could be improved but it's a start. It's worth noting that this method might match elements from the settings.php file that aren't actually variables in the database as such.

For example, if your prefix is data, it's likely you'll see the $conf['databases'] variable from settings.php in your results. There wouldn't be a way around that without going directly into the db I don't think.