I've been trying to extract an array from a PHP function. But I only get a NULL. Here's the code that the function involves:
Function itself:
public static function priceIDToLabel($priceID){
//Ermittelt mithilfe der PriceID das dazugehörige Ticket -> (label)
$conn = global_functions::connectdb();
$errormsg = '';
$sql = 'SELECT label FROM data WHERE priceID = ".$priceID."';
$result = $conn->query($sql);
//$ticketLabel = array();
while ($ticketLabel = $result->fetch_assoc()){
$ticketLabel[] = $result->fetch_assoc();
}
return($ticketLabel);
}
The site that should display the Array from the function above:
<table>
<!-- WARUM wird $ticketLabel nicht gefüllt, bzw nicht angezeigt?! -->
<!-- Weil wegen isset! Und zu wenig Kaffee!.. -->
<?php
$ticketLabel['label'] = global_functions::priceIDToLabel($selTicket);
echo '<textarea readonly>' .$ticketLabel['label'] . ' </textarea>';
?>
</table>