Articulos PHP
- 1.5 Hacer comparaciones de valores.
- 1.9 Como desplazarse dentro de un arreglo o array.
- 1.8 Arreglos o array.
- 1.7 Enunciado exit o die.
- 1.4 Trabajar con números en PHP.
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
- 1 Jquery
- 2.5 Recorriendo el array con each().
- 1.6 El método preventDefault.
- 2.9 Valor de un campo de texto con attr().
- 2.2 Introduciendo texto usando el método .text().
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
- 2.9 Insertando datos con INSERT.
- 3.7 Modificar la estructura de una tabla con ALTER TAB
- 2.7 Conjunción interna de tablas.
- 3.9 Privilegios o permisos en MySQL
- 2.6 Combinando resultados con UNION ALL.
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



