-3
How can I concatenate a while to put into an array. How to make this part of code work?
$nestedData[] = $row["nomerota"];
$tr="<select size='1'>";
$tr.= while ($row = mysqli_fetch_array($resultado))
{
<option value='$row['nome'];'>$row['nome'];</option>
}
$tr.="</select>";
$nestedData[] = $tr;
my problem is here:
$tr.= while ($row = mysqli_fetch_array($resultado))
{
<option value='$row['nome'];'>$row['nome'];</option>
}
Instead of
$tr.= while
do$tr.= "<option value='".$row['nome']."'>".$row['nome']."</option>";
– NoobSaibot
You have unconnected code

 <option value='$row['nome'];'>$row['nome'];</option> 

– Fabiano Monteiro
Pq you do not loop and concatenate the string?
– Gabriel Carvalho