Ver Mensaje Individual
  #10 (permalink)  
Antiguo 27/06/2006, 19:43
norpool1
 
Fecha de Ingreso: junio-2006
Ubicación: Jáltipan Veracruz, México
Mensajes: 150
Antigüedad: 17 años, 11 meses
Puntos: 1
sino lo tienes en la tabla operacion agrega al final un campo con el nombre codigo tipo int. para partir de ahí

coloca est código en la parte que corresponda, digamos que ya va actualizdo
va despues del
f ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
sobre escribe al otro.

Código PHP:
mysql_select_db($database_connections1$connections1);
do{
$cod rand(1000,100000); 
$cons=mysql_query("select codigo from operacion where codigo='$cod'",$connections1)
$row=mysql_fetch_row($cons);
if(
$row[0]=="")
{
$cod=intval($cod);
$insertSQL sprintf("INSERT INTO operacion (monto, banco, noperacion, rem_nombre, rem_apellido, rem_telefono, rem_mail, rem_mensaje, ben_nombre, ben_apellido, ben_telefono, ben_mail,codigo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['monto'], "int"),
GetSQLValueString($_POST['banco'], "text"),
GetSQLValueString($_POST['operacion'], "text"),
GetSQLValueString($_POST['nombre_re'], "text"),
GetSQLValueString($_POST['apellidos_re'], "text"),
GetSQLValueString($_POST['telefono_re'], "text"),
GetSQLValueString($_POST['mail_re'], "text"),
GetSQLValueString($_POST['mensaje_re'], "text"),
GetSQLValueString($_POST['nombre_be'], "text"),
GetSQLValueString($_POST['apellido_be'], "text"),
GetSQLValueString($_POST['telefono_be'], "text"),
GetSQLValueString($_POST['mail_be'], "text"),'$cod');

$Result1 mysql_query($insertSQL$connections1) or die(mysql_error());

}
}
while(
$row!=''); 

prueba a ver si funciona, espero no haberme equivocado.

Última edición por jam1138; 30/06/2006 a las 23:03