You are here

function currency_api_save in Currency 5

Same name and namespace in other branches
  1. 6 currency_api/currency_api.module \currency_api_save()
  2. 7 currency_api/currency_api.module \currency_api_save()

cache rate for from and to countries delete outdated record, if exists returns: true/false result from insert

1 call to currency_api_save()
currency_api_convert in currency_api/currency_api.module
Currency exchange rate API function

File

currency_api/currency_api.module, line 643

Code

function currency_api_save($currency_from, $currency_to, $rate) {

  // delete outdated record, if exists
  db_query("DELETE FROM {currencyapi} WHERE currency_from = '%s' AND currency_to = '%s'", $currency_from, $currency_to);
  return db_query("INSERT INTO {currencyapi} VALUES ('%s', '%s', %f, %d)", $currency_from, $currency_to, $rate, time());
}