Articulos PHP
- 1.6 Unir comparaciones.
- 2.2 Ciclo FOR.
- 1.4 Trabajar con números en PHP.
- 2.8 Usar funciones para código redundante.
- 3 PHP junto con MySQL.
Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 128
Articulos Jquery
- 2.2 Introduciendo texto usando el método .text().
- 1.8 Creando elementos con Jquery
- 2.8 Valor de una lista desplegable con attr().
- 3 Concatenar efectos con Jquery.
- 2.6 El efecto fadeIn y fadeOut.
Warning: Use of undefined constant jquery - assumed 'jquery' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 137
Articulos CSS
- 1 Hojas de estilo CSS.
- 1.1 Como incluir estilos en una página web.
- 1.2 Estructura de los estilos CSS.
Warning: Use of undefined constant css - assumed 'css' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 146
Articulos Mysql
- 3.4 Creando una tabla con CREATE TABLE.
- 2.8 Conjunción externa de tablas.
- 1.9 Seleccionar filas con la expresión columna=valor
- 1.7 Ordenar valores de forma descendente.
- 1.6 Ordernar valores con ORDER BY.
Warning: Use of undefined constant mysql - assumed 'mysql' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 155
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 199
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 220
Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 220
2.4 El ciclo WHILE().
El ciclo WHILE() sirve para repetir un determinado bloque de código una vez que se haya comprobado determinada condición como verdadera. La estructura del while es como sigue:
while(condición){
  Bloque de código…
}
Para entender mejor supongamos que tenemos el siguiente código:
$numeroEmpleados=5;
while($numeroEmpleados<=100){
echo “Los empleados que hay actualmente son ”.$numeroEmpleados.”</br>”;
$numeroEmpleados=$numeroEmpleados+5;
}
Como se puede ver en el código anterior, primeramente se declara una variable $numeroEmpleados=5. Después se declara un while, en el cual, como condición para que se ejecute el código, el valor de $numeroEmpleados debe ser menor o igual a 100.Durante cada iteración el valor de la variable $numeroEmpleados incrementa en 5 y asà sucesivamente hasta llegar a 105 que es cuando se excede 100 y por tanto ya no se repite el bloque de código. Por cada iteración se imprime en la ventana del navegador una frase indicando la cantidad de empleados en ese momento, de forma que la salida o output del script anterior serÃa:
Los empleados que hay actualmente son 5
Los empleados que hay actualmente son 10
Los empleados que hay actualmente son 15
…
Los empleados que hay actualmente son 100
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 225
Ciclo WHILE.
Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 225
2.4