SELECT t1.*
FROM users_list
WHERE EXISTS(
SELECT t2.id
FROM users_groups t2
WHERE t2.user_id = t1.id AND FIND_IN_SET(t2.id, '1,2,3,4,и другие id групп через ,')
)
$('#filterForm').submit(function(q){
q.preventDefault();
/* your code ... */
});
var uTimeout = false, uRequest = false, uFunction = function(){
if (uRequest !== false) {
uRequest.abort();
}
if (uTimeout !== false) {
clearTimeout(uTimeout);
}
uTimeout = setTimeout(function(){
uRequest = $.get('reload.php', {}, function(q){
/* действия с DOM */
uRequest = false;
uTimeout = false;
uFunction();
});
}, 2000);
};
uFunction();
<table id="table"><tr><td><span data-id="name">Иван Петрович</span></td></tr></table>
<script>
var form = $('<form />');
$('#table').find("td").each(function(k,v){
$form.append('<input type="hidden" value="' + $(v).find('[data-id=name]').text() + '"');
});
$form.submit();
</script>
/**
* Redirect with POST data.
*
* @param string $url URL.
* @param array $post_data POST data. Example: array('foo' => 'var', 'id' => 123)
* @param array $headers Optional. Extra headers to send.
*/
public function redirect_post($url, array $data, array $headers = null) {
$params = array(
'http' => array(
'method' => 'POST',
'content' => http_build_query($data)
)
);
if (!is_null($headers)) {
$params['http']['header'] = '';
foreach ($headers as $k => $v) {
$params['http']['header'] .= "$k: $v\n";
}
}
$ctx = stream_context_create($params);
$fp = @fopen($url, 'rb', false, $ctx);
if ($fp) {
echo @stream_get_contents($fp);
die();
} else {
// Error
throw new Exception("Error loading '$url', $php_errormsg");
}
}