I have the following code:
$result7 = mysqli_query($conn, $sql7);
$resalm = mysqli_query($conn, $contalm);
$p = array();
while($row_alm = mysqli_fetch_array($resalm)) {
$p[] = $row_alm['nome'];
}
while($rows_cursos7 = mysqli_fetch_array($result7)) {
$tabela8 .= '<td><button type="button" class="btn btn-info btn-xs" data-toggle="tooltip" data-placement="top" title='.$p.'>'.$rows_cursos7['Almoço'].'</button></td>';
}
The problem is that if you do it inside the while print_r($p)
it returns the data coming from the database.
But inside the button title='.$p.'
it only returns array and not the data that comes from the database. Can you help?
` is the HTML newline tag (and that's assuming the intervening code doesn't strip or encode HTML tags in the source data). – ADyson Jul 28 '23 at 16:14
, $p). '"`, `"'.implode(", ", $p).'"`, `"'.implode(", ", $p).'"`. None resulted – Anonimo Jul 28 '23 at 16:29