You are here

function _eloqua_insert_query in Eloqua 6

Inserts data into the database and returns the last insert ID, or TRUE

Parameters

$sql string: Query

$params array: Query Parameters

$table string: Table

$pid string|array: Primary Key

Return value

boolean|int Success status, or the last inserted ID if the Table and Primary Key are filled

2 calls to _eloqua_insert_query()
_eloqua_post_create in ./eloqua.inc
Creates the post object from the database
_eloqua_webform_create in ./eloqua.inc
Creates the webform object from the database

File

./eloqua.inc, line 644

Code

function _eloqua_insert_query($sql, $params, $table = NULL, $pid = NULL) {
  $result = db_query($sql, $params);
  if ($result != FALSE) {
    if (!empty($table) && !empty($pid)) {
      $result = db_last_insert_id($table, $pid);
    }
    else {
      $result = db_affected_rows() > 0;
    }
  }
  return $result;
}