[Solved] Turning a SQL row into an array
If you only want specific associative properties from all columns queried from the MySQL call, just set them in an array with their respective properties: $categoriesTest = array(); $sql = “SELECT * FROM `respondent_data` WHERE `respondent_firstname` = ‘John'”; $result = mysqli_query($conn, $sql); while($row = mysqli_fetch_assoc($result)) { $categoriesTest[] = array( ‘respondent_sdo’ => $row[‘respondent_sdo’], ‘respondent_dcto’ => $row[‘respondent_dcto’], … Read more