buonasera a tutti è da tutto il giorno che sono su questo problema ed ormai mi sono esaurita
Ho la seguente tabella:
Table A
id name
111 Jenny
112 John
113 Rick
voglio questo output:
Mansioni: 111 People :Giovanna,Jenny
112 People :John
113 People: Rick
Il mio codice php:
Codice PHP:
$codice=$_GET['id']; //id is is chosen by the user
$query1="select distinct ID from A where ID= '".$codice."'";
$query2="select distinct name from A where ID= '".$codice."'";
$query_imp = pg_query($conn1, $query1);
$query_impiegati = pg_query($conn1, $query2);
echo 'Mansioni: ';
while($row1 = pg_fetch_array($query_imp)){
while($row2 = pg_fetch_array($query_impiegati)){ ;
echo '</table>';
echo '<tr>
<td>'.$row1['ID'].'
People:'.$row2['name'].'<br></td>
</tr>';
echo '</table>';
}
}
Il codice non fa errore ma non fa quello che volevo.Come posso fare?