Código PHP:
<?php
$consulta_turnos = mysql_query("SELECT
establecimientos.id,
turnos.turno,
establecimientos2turnos.id_turno
FROM
establecimientos
LEFT JOIN establecimientos2turnos ON establecimientos.id = establecimientos2turnos.id_est
LEFT JOIN turnos ON establecimientos2turnos.id_turno = turnos.id
WHERE
establecimientos.id = '$id'",$connect);
while($turnos = mysql_fetch_assoc($consulta_turnos))
{
?>
Mañana: <input name="manana" type="checkbox" value="M"
<?php
if ($turnos['id_turno'] == 1)
{
echo "checked=\"checked\"";
}
?>
/>
Tarde: <input name="tarde" type="checkbox" value="T"
<?php
if ($turnos['id_turno'] == 2)
{
echo "checked=\"checked\"";
}
?>
/>
Vespertino: <input name="vespertino" type="checkbox" value="V"
<?php
if ($turnos['id_turno'] == 3)
{
echo "checked=\"checked\"";
}
?>
/>
Noche: <input name="noche" type="checkbox" value="N"
<?php
if ($turnos['id_turno'] == 4)
{
echo "checked=\"checked\"";
}
?>
/><br /><br />
<?php
}
mysql_free_result($consulta_turnos);
?>
Con qué expresión puedo reemplazar el while, para que quede todo como está, pero sin repetir la fila tantas veces?
Gracias!!!