tengo un codigo para actuializar un campo en una base de datos, pero lo que ponga lo reproduce 3 veces osea pone 3 veces el valor que yo suba, este es el codigo:
Código PHP:
<?
session_start();
include('incluir/config.php');
?>
<!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=iso-8859-1" />
<title>Admin Galva-X</title>
</head>
<?
if($_POST["si"]=="1"){
$mcampo=$_POST['modicampo'];
$sql="UPDATE prueba SET prueba='$mcampo'";
mysql_query($sql) or mysql_error();
}
?>
<body>
<form name='editar' action='<? $_SERVER['PHP_SELF']; ?>' method='post'>
<input type="hidden" value="1" name="si" style="display:none" />
<textarea name='modicampo' cols='50' rows='8'><?
$x = "SELECT * FROM prueba";
$xx = mysql_db_query($base,$x) or die (mysql_error());
while($xxx = mysql_fetch_array($xx))
{
echo "".$xxx["prueba"]."";
}
?>
</textarea>
<input type='submit' name='enviar' value='Enviar'>
</form>
</body>
</html>
creo que el problema es que no tengo el WHERE pero para poder ponerlo necesito la id del campo y pss no se como ponerla.