X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fpool-functions.php;h=b183001d23e4c50a2e92dda1dced98d9d6f4ad6a;hb=f888a0bda52e7dd2ea799837ed2991c263864e9f;hp=81a303eea527037197153eebb00cb08ec5ab1cde;hpb=c3db0c416433a946c25ea1ce8d9329c0912a1616;p=mailer.git diff --git a/inc/pool-functions.php b/inc/pool-functions.php index 81a303eea5..b183001d23 100644 --- a/inc/pool-functions.php +++ b/inc/pool-functions.php @@ -126,5 +126,17 @@ function updatePoolDataById ($poolId, $columnName, $data, $updateMode = NULL, $w return (SQL_AFFECTEDROWS() == 1); } +// Insert data into pool and return its insert id +function insertDataIntoPool ($data) { + // Construct SQL query + $sql = 'INSERT INTO `{?_MYSQL_PREFIX?}_pool (`' . implode('`,`', array_map('SQL_ESCAPE', array_keys($data))) . "`) VALUES ('" . implode("','", array_values($data)) . "')"; + + // Run the query + SQL_QUERY($sql, __FUNCTION__, __LINE__); + + // Return insert id + return SQL_INSERT_ID(); +} + // [EOF] ?>