Amigos, estoy atascado con el while de mysql, no se como sacar los datos sin que se me multipliquen tantos espacios. tengo esto:
Código PHP:
Ver original<?php
// I create the db connection
//testing connection
if (!$conn){
}
//selecting a db
//Selecting the Query from patients_control
$sql = mysql_query("SELECT * FROM reuniones ORDER BY id ASC");
//Hacemos el if/else para ver si se han seteado en la url mediante GET los parametros wk = semana
$week = isset($_GET['wk']) ?
$_GET['wk'] : ''; //Si es lunes calculamos a partir de la fecha actual
//verificamos si la variable $week no esta vacia
//Si no esta vacia agregamos el valor de $week asignandole la marca de tiempo UNIX
} else {
//Si esta vacia simplemente le damos la marca de tiempo UNIX
}
} else {
} else {
}
}
//Array con los dias de la semana
$dias_semana = array('Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'); //Array Horas del dia
$hours = array("6:00", "7:00", "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Calendar Sample</title>
<link rel="shortcut icon" href="icon" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
var h = document.body.scrollHeight;
var nh = Math.round(h/18);
$('.tableheight').css({'height':h});
$('.trheight').css({'height':nh});
});
</script>
</head>
<body>
<!-- Table: General -->
<table class="tableheight" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ddd" >
<tr>
<th class="trheight"><a href="index.php?wk=<?php echo $week-1; ?>">Prev</a>-<a href="index.php?wk=<?php echo $week+1; ?>">Next</a></th>
<?php
//Bucle para mostrar los 7 dias de la semana
for($i=0;$i<7;$i++){
//Sumamos días a la fecha del lunes actual
//comprobamos si la fecha del bucle es la fecha actual
//colocamos el dia actual en rojo y ponemos el array para mostrar los dias en español
echo '<th width="12.5%"><font color="red">'.$dias_semana[$i].', '.date("d", $sd).'</font></th>'; } else {
//colocamos el el resto de los dias en gris y ponemos el array para mostrar los dias en español
echo '<th width="12.5%"><font color="black">'.$dias_semana[$i].', '.date("d", $sd).'</font></th>'; }
}
//hago los dias
for($h=0; $h < count($hours); $h++) { echo '<tr><th>';
echo $hours[$h];
echo '</th>';
for($y=0;$y<7;$y++){
//>>>>>>>>>>> AQUI CREO QUE DEBERIA IR EL WHILE PERO NO ME FUNCIONA, AYUDA PORFA
echo '<td width="12.5%"><font color="black">'.date("Y-m-d", $xxx).'</font></td>'; }
echo '</tr>';
}
?>
</tr>
</table>
<!-- Table: General -->
</body>
</html>
Gracias