Created
May 20, 2022 07:13
-
-
Save jxpsert/59e72fb28543089d9a6ad663476f8623 to your computer and use it in GitHub Desktop.
functie getAllRubrics
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
| /* | |
| Returns all rubrics as an array. | |
| */ | |
| function getAllRubrics() { | |
| global $conn; | |
| $sql = "SELECT * FROM rubriek ORDER BY rubriek, rubrieknaam ASC"; | |
| $stmt = sqlsrv_query($conn, $sql); | |
| $newArr = []; | |
| while($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) { | |
| $arr = []; | |
| $arr['id'] = $row['rubrieknummer']; | |
| $arr['name'] = utf8_encode($row['rubrieknaam']); | |
| $arr['parentid'] = $row['rubriek']; | |
| array_push($newArr, $arr); | |
| } | |
| return $newArr; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment