I get some information from database! I need to place it on the array! How to add value to array in cycle??? I did this, but it did not wirk:
a[]='';
while ($p = mysqli_fetch_assoc($queryAns)) {
$countAnswers++;
a[] = $p['name'];
$arr .= $countAnswers.") "." ".$p['name']."
";
}
The .= operator in PHP is used to concatenate strings. In order to append a new element to your array you need to do:
array_push($arr, $countAnswers.") "." ".$p['name']."
");