Last active
June 12, 2020 17:05
-
-
Save supernovaplus/16b815b4df41a1bd0e619fae71015ce0 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 | |
//case(3): array_push($fetch_array, [&$response->vouchers,"select * from vouchers_config;"]); break; | |
function fetchdb($data){ | |
global $response, $conn; | |
$query = ""; | |
for ($i=0; $i < count($data); $i++) { | |
$query .= $data[$i][1]; | |
} | |
if (mysqli_multi_query($conn, $query)) { | |
$column = 0; | |
do { | |
$data[$column][0] = []; | |
if ($result = mysqli_store_result($conn)) { | |
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { | |
array_push($data[$column][0], $row); | |
} | |
mysqli_free_result($result); | |
$column++; | |
} | |
} while (mysqli_next_result($conn)); | |
} | |
} | |
fetchdb($fetch_array); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment