Te puedo dar un ejemplo de como hacer,
(lo he probado y funciona a la perfeccion)
Primero lo que hice fue crear una tabla en la base de datos (seguro ya lo tienes)
con el nombre:
bucle_while (
![sonriente](http://static.forosdelweb.com/fdwtheme/images/smilies/smile.png)
)
y como campos:
nombre, apellido
Ahora crearemos nuestra conexion a la BD:
Nombre:
mysql.php Código PHP:
<?php
class MySQL{
private $conexion;
private $total_consultas;
public function MySQL(){
if(!isset($this->conexion)){
$this->conexion = (mysql_connect("localhost","usuario","no_te_la_digo")) or die(mysql_error());
mysql_select_db("NOMBRE_DE_TU_BD",$this->conexion) or die(mysql_error());
}
}
public function consulta($consulta){
$this->total_consultas++;
$resultado = mysql_query($consulta,$this->conexion);
if(!$resultado){
echo 'MySQL Error: ' . mysql_error();
exit;
}
return $resultado;
}
public function fetch_array($consulta){
return mysql_fetch_array($consulta);
}
public function num_rows($consulta){
return mysql_num_rows($consulta);
}
public function getTotalConsultas(){
return $this->total_consultas;
}
}
?>
Luego el siguiente paso crear mi formulario html para pedir los datos:
(sacado del que posteaste pero arreglado, pues tenia ciertas falencias, compara con el que te paso para que veas en que partes)
Nombre del HTML =
bucle_while_carga_mas_valores.html (aunque no uso el while pero le di ese nombre puesto que use como referencia tu post
![sonriente](http://static.forosdelweb.com/fdwtheme/images/smilies/smile.png)
)
Código HTML:
<html>
<head>
<title>Llenar el formulario</title>
</head>
<fieldset style="border-color:#0066FF;padding-right:left;border-style:solid;">
<body>
<p>
<!-- llamada del formulario -->
</p>
<form action="guardar_datos_bucle.php" method="post">
<!-- llenar el formulario -->
<h3><fieldset style="border-color:#0066FF;padding-right:left;border-style:solid;"><legend>PARTICIPANTES</legend>
Nombre <input type="text" name="nombre"/>  
Apellido <input type="text" name="apellido"/>
<input type="submit" name="otra" value="Guardar Datos" /> <input type="reset" name="reset" value="Resetear Valor" /></fieldset></h3><br>
</form>
</fieldset>
</body>
</html>
luego el siguiente paso es crear un
php que inserte los datos en la BD y te pida si queres insertar otro.
Nombre =
guardar_datos_bucle.php Código PHP:
<?php
//llamaremos a nuestra conexion y crearemos una nueva consulta SQL
include("mysql.php");
$db = new MySQL();
//ahora capturaremos las datos enviados
$nombre=$_POST['nombre'];
$apellido=$_POST['apellido'];
//controlaremos que los valores no vengan vacios
if (!$nombre=='' && !$apellido=='')
{
$db->consulta("INSERT INTO bucle_while(nombre, apellido) VALUES ('$nombre', '$apellido')");
echo '<html>
<head>
<title>Llenar el formulario</title>
</head>
<fieldset style="border-color:#0066FF;padding-right:left;border-style:solid;">
<body>
<p>
</p>
<form>
<h3><fieldset style="border-color:#0066FF;padding-right:left;border-style:solid;"><legend>Mensaje Base de Datos</legend>
<center>Datos Guardados con Exito</center>
</fieldset></h3><br>
</form>
<form action="bucle_while_carga_mas_valores.html">
<h3><fieldset style="border-color:#0066FF;padding-right:left;border-style:solid;"><legend>Desea cargar mas datos?</legend>
<input type=submit name=si value=Si /> <a href="http://www.google.com.py"><input type="button" name="no" value="No" /></a></fieldset></h3><br>
</form>
</fieldset>
</body>
</html>';
}else{
echo '
<form>
<h3><fieldset style="border-color:#0066FF;padding-right:left;border-style:solid;"><legend>Mensaje Base de Datos</legend>
<center>A ocurrido un error y no se ha guardado nada en la Base de datos</center>
</form>
<form action="bucle_while_carga_mas_valores.html">
<h3><fieldset style="border-color:#0066FF;padding-right:left;border-style:solid;"><legend>Desea Volver a intentar?</legend>
<input type="submit" name="si" value="Si" /> <a href="http://www.google.com.py"><input type="button" name="no" value="No" /></a></fieldset></h3><br>
</form>
</fieldset></h3><br/>
';
}
?>
Eso es todo, lo unico que deberias programar a tu criterio, seria si ya no quiere insertar mas datos, o sea el boton NO, ahora con este ejemplo te redirecciona a google
ojala te sirva...
salu2