Last active
February 8, 2016 21:00
-
-
Save s-melnikov/b7e93e9fe7943b5dfce9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// массив для результата выборки | |
$data = array(); | |
if (isset($_POST['filter'])) { | |
foreach ($_POST['info_department'] as $selected) { | |
$sql = "SELECT * FROM info WHERE info_department = '$selected' ORDER BY info_id DESC"; | |
$result = $connect->query($sql); | |
$result_array = $result->fetch_all(MYSQLI_ASSOC); | |
//складываем все в один массив (мержим массивы) | |
$data = array_merge($data, $result_array); | |
} | |
} | |
var_dump($data); //результат выборки |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment