23 lines
589 B
PHP
23 lines
589 B
PHP
<?php
|
|
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");
|
|
|
|
ini_set('display_errors', 1);
|
|
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE);
|
|
|
|
if (isset($_POST) && isset($_POST['userId'])) {
|
|
|
|
$post = clearInputData($_POST);
|
|
|
|
$userId = $post['userId'];
|
|
|
|
$links = $post['links'];
|
|
|
|
$sqlClear = "DELETE FROM feed_adv_phone_user WHERE user_id = $userId";
|
|
mysql_query($sqlClear);
|
|
|
|
foreach ($links as $id) {
|
|
$sqlInsert = "INSERT INTO feed_adv_phone_user (feed_adv_phone_id, user_id) VALUES ($id, $userId)";
|
|
mysql_query($sqlInsert);
|
|
}
|
|
} |