if (isGetRequestParameterSet('id')) {
// Check for selected sponsor
- $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id`, `email`, `gender`, `surname`, `family` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Remove sponsor
$content = SQL_FETCHARRAY($result);
// Prepare data for the template
- $content['gender'] = translateGender($content['gender']);
$content['reason'] = secureString(postRequestParameter('reason'));
// Prepare message and send it away
sendEmail($content['email'], '{--ADMIN_SPONSOR_DELETE_SUBJECT--}', $message);
// Remove account
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`='%s' LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
// Remove orders
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_orders` WHERE `sponsorid`='%s' LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_orders` WHERE `sponsor_id`='%s' LIMIT 1",
array(bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
// Output message