- ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_payments` (time, payment, mail_title, price) VALUES ('".REQUEST_POST('t_wait')."','".REQUEST_POST('payment')."','".REQUEST_POST('title')."','".REQUEST_POST('price')."')");
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_payments` WHERE time='%s' LIMIT 1",
- array(REQUEST_POST('t_wait')), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1) {
- // Re-init the array here
- INIT_SQLS();
-
- // Free memory
- SQL_FREERESULT($result);
- }
+ if (countSumTotalData(postRequestElement('t_wait'), 'payments', 'id', 'time', TRUE) == 0) {
+ addSql("INSERT INTO
+ `{?_MYSQL_PREFIX?}_payments`
+(
+ `time`,
+ `payment`,
+ `mail_title`,
+ `price`
+) VALUES (
+ '" . postRequestElement('t_wait') . "',
+ '" . postRequestElement('payment') . "',
+ '" . postRequestElement('title') . "',
+ '" . postRequestElement('price') . "'
+)");
+ } // END - if