Foros del Web » Programación para mayores de 30 ;) » Bases de Datos General »

Problemas Mysql

Estas en el tema de Problemas Mysql en el foro de Bases de Datos General en Foros del Web. Hola tengo una web recien echa que me da un problema al registrarse en un formulario los usuarios y darle enviar en el primer intento ...
  #1 (permalink)  
Antiguo 31/05/2003, 11:57
 
Fecha de Ingreso: junio-2002
Mensajes: 70
Antigüedad: 21 años, 10 meses
Puntos: 0
Problemas Mysql

Hola tengo una web recien echa que me da un problema al registrarse en un formulario los usuarios y darle enviar en el primer intento sale este error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site2/fst/var/www/html/savereg.php on line 38

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site2/fst/var/www/html/savereg.php:38) in /home/virtual/site2/fst/var/www/html/incs/funcs.inc.php on line 27

a continuación posteo dos scripts los cuales pienso que seran los causantes de tal error , pero yo no he localizadop el error pues no se mucho de mysql y php. Gracvias de antemano a todos
INTENTARE POSTEAR DOS SCRIPTS SI NO SON MUY EXTENSOS

el primer cacho del script los posteo a continuación

<?

include("incs/funcs.inc.php");

connect();



$query="select * from sexo;";

$rsexos=mysql_query($query);



$query="select * from lenguajes;";

$rlenguajes=mysql_query($query);



$query="select * from paises;";

$rpaises=mysql_query($query);



$query="select * from educacion;";

$reducacion=mysql_query($query);



$query="select * from ocupacion;";

$rocupacion=mysql_query($query);



$query="select * from zodiaco;";

$rzodiaco=mysql_query($query);



$query="select * from tipo_de_encuentro;";

$rtipo_de_encuentro=mysql_query($query);



$query="select * from relacion_buscada;";

$rrelacion_buscada=mysql_query($query);



$query="select * from comoconn;";

$rcomoconn=mysql_query($query);

?>

<html>

<head>

<title>:: FlirtMonopol ::</title>

<link rel="stylesheet" type="text/css" href="/styles.css">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript">

<!--

function MM_findObj(n, d) { //v4.0

var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

if(!x && document.getElementById) x=document.getElementById(n); return x;

}



function MM_validateForm() { //v4.0

var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;

for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);

if (val) { nm=val.name; if ((val=val.value)!="") {

if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');

if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';

} else if (test!='R') {

if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';

if (test.indexOf('inRange') != -1) { p=test.indexOf(':');

min=test.substring(8,p); max=test.substring(p+1);

if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';

} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }

} if (errors) alert('The following error(s) occurred:\n'+errors);

document.MM_returnValue = (errors == '');

}

//-->

</script>

</head>



<body bgcolor="#FFFFFF" text="#000000" background="img/top1.gif">



<table width="100" border="0" cellspacing="0" cellpadding="0">

<tr>

<td>

<?include ("incs/top.inc.htm")?>

</td>

</tr>

<tr>

<td align="center">

<table width="0%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="12"><img src="/img/arr_izq.gif" width="12" height="12"></td>

<td background="/img/arr.gif"><img src="/img/arr.gif" width="3" height="12"></td>

<td width="12"><img src="/img/arr_der.gif" width="12" height="12"></td>

</tr>

<tr>

<td width="12" background="/img/izq.gif"><img src="/img/izq.gif" width="12" height="3"></td>

<td>

<form action="/savereg.php?nombre=$nombre&apellido=$apellido&emai l=$email&password=$password" name="FrmReg" method="post">

<table width="101" border="0" cellspacing="0" cellpadding="0" class="TextNormal">

<tr>

<td>email</td>

<td>

<input type="text" name="email" class="Box">

</td>

</tr>

<tr>

<td>password</td>

<td>

<input type="text" name="password" class="Box">

</td>

</tr>

<tr>

<td>Vorname</td>

<td>

<input type="text" name="nombre" class="Box">

</td>

</tr>

<tr>

<td>Nachname</td>

<td>

<input type="text" name="apellido" class="Box">

</td>

</tr>

<tr>

<td>Geschlecht</td>

<td>

<select name="sexo" class="Box">

<?

while ($row=mysql_fetch_array($rsexos)) {

?>

<option value="<?=$row["id_sexo"]?>">

<?=$row["descripcion"]?>

</option>

<?

}

?>

</select>

</td>

</tr>

<tr>

<td>Sprache</td>

<td>

<select name="lenguaje" class="Box">

<?

while ($row=mysql_fetch_array($rlenguajes)) {

?>

<option value="<?=$row["id_lenguaje"]?>">

<?=$row["descripcion"]?>

</option>

<?

}

?>

</select>

</td>

</tr>

<tr>

<td>Alter</td>

<td>

<input type="text" name="edad" class="Box">

</td>

</tr>

<tr>

<td>Statur (m) (ej: 1.78)</td>

<td>

<input type="text" name="estatura" class="Box">

</td>

</tr>

<tr>

<td>rauchen Sie?</td>

<td>

<select name="fuma" class="Box">

<?



echo "<option value=1>";

echo "Ja";

echo "</option>";



echo "<option value=0>";

echo "Nein";

echo "</option>";





?>

</select>

</td>

</tr>

<tr>

<td>Geburtsdatum<br>

(yyyy-mm-dd)</td>

<td>

<input type="text" name="nacimiento" class="Box">

</td>

</tr>

<tr>

<td>Adresse</td>

<td>

<input type="text" name="domicilio" class="Box">

</td>

</tr>

<tr>

<td>Postleitzahl</td>

<td>

<input type="text" name="codpostal" class="Box">

</td>

</tr>

<tr>

<td>Ort</td>

<td>

<input type="text" name="localidad" class="Box">

</td>

</tr>

<tr>

<td>Land</td>

<td>

<select name="pais" class="Box">

<?

/*segunda parte del script */
while ($row=mysql_fetch_array($rpaises)) {

?>

<option value="<?=$row["id_pais"]?>">

<?=$row["descripcion"]?>

</option>

<?

}

?>

</select>

</td>

</tr>

<tr>

<td>Telefon</td>

<td>

<input type="text" name="telefono" class="Box">

</td>

</tr>

<tr>

<td>Handy</td>

<td>

<input type="text" name="celular" class="Box">

</td>

</tr>

<tr>

<td>Studium</td>

<td>

<select name="educacion" class="Box">

<?

while ($row=mysql_fetch_array($reducacion)) {

?>

<option value="<?=$row["id_educacion"]?>">

<?=$row["descripcion"]?>

</option>

<?

}

?>

</select>

</td>

</tr>

<tr>

<td>Beruf</td>

<td>

<select name="ocupacion" class="Box">

<?

while ($row=mysql_fetch_array($rocupacion)) {

?>

<option value="<?=$row["id_ocupacion"]?>">

<?=$row["descripcion"]?>

</option>

<?

}

?>

</select>

</td>

</tr>

<tr>

<td>Beziehung</td>

<td>

<select name="relacion_buscada" class="Box">

<?

while ($row=mysql_fetch_array($rrelacion_buscada))

{

echo "<option value=".$row["id_relacion_buscada"].">";

echo $row["descripcion"];

echo "</option>";



}

?>

</select>

</td>

</tr>



<tr>

<td>Kontaktwunsch</td>

<td><select name="tipo_de_encuentro" class="Box">

<?

while ($row=mysql_fetch_array($rtipo_de_encuentro))

{

if ($row["id_tipo_de_encuentro"]==$row2["id_tipo_de_encuentro"])

{

echo "<option value=".$row["id_tipo_de_encuentro"]." selected>";

echo $row["descripcion"];

echo "</option>";

}

else

{

echo "<option value=".$row["id_tipo_de_encuentro"].">";

echo $row["descripcion"];

echo "</option>";

}

}

?>

</select></td>

</tr>



<tr>

<td>Sternzeichen</td>

<td>

<select name="zodiaco" class="Box">

<?

while ($row=mysql_fetch_array($rzodiaco))

{

echo "<option value=".$row["id_zodiaco"].">";

echo $row["descripcion"];

echo "</option>";



}

?>

</select>

</td>

</tr>

<tr>

<td>commoconn</td>

<td>

<select name="comoconn" class="Box">

<?

while ($row=mysql_fetch_array($rcomoconn)) {

?>

<option value="<?=$row["id_comoconn"]?>">

<?=$row["descripcion"]?>

</option>

<?

}

?>

</select>

</td>

</tr>

<tr>

<td>Descripcion</td>

<td> <textarea name="descrip" cols="35" rows="5" class="Box"></textarea>

</td>

</tr>

<tr>

<td>newsletter</td>

<td><input type="checkbox" name="newsletter" value="1" class="Box"></td>



</tr>



<tr>

<td>&nbsp;</td>

<td>

<input type="submit" name="Enviar" value="Weiter" onClick="MM_validateForm('email','','RisEmail','pa ssword','','R','nombre','','R','apellido','','R',' nacimiento','','R','domicilio','','R','codpostal', '','R','localidad','','R','telefono','','R','celul ar','','R','estatura','','R','edad','','R');return document.MM_returnValue" class="Box">

</td>

</tr>

</table>

</form>

</td>

<td width="12" background="/img/der.gif"><img src="/img/der.gif" width="12" height="8"></td>

</tr>

<tr>

<td width="12"><img src="/img/aba_izq.gif" width="12" height="12"></td>

<td background="/img/aba.gif"><img src="/img/aba.gif" width="2" height="12"></td>

<td width="12"><img src="/img/aba_der.gif" width="12" height="12"></td>

</tr>

</table>

</td>

</tr>

<tr>

<td><?include ("incs/footer.inc.php")?></td>

</tr>

</table>

</body>
</html>

SI ALGUIEN CONSIGUE DECIRME A QUE SE DEBE EL PROBLEMA POR EL CUAL NO FUNCIONA CORRECTAMENTE EL FORMULARUIO DE REGISTRO ESTARIA MUY AGRADECIDO AMIGOS.
SALUDOS
__________________
Rob
Queridas Islas cies te estan llenando de fuel , ¡¡¡putos políticos de mierda que me las vais a joder(os quería ver nandando en fuel a todos CABRONES¡¡¡
  #2 (permalink)  
Antiguo 07/06/2003, 19:48
Avatar de LeoIglesias  
Fecha de Ingreso: enero-2003
Ubicación: Concepcion del Uruguay
Mensajes: 53
Antigüedad: 21 años, 3 meses
Puntos: 0
El primer error es de tu base de datos, el PHP te dice que hay un nerror en los resultados del query. Deberias colocar mysql_error() para ver cual es el error que tenes.

El segundo error es con las cabeceras, recorda que hay ciertas cositas -cookies, headers, etc- que deben estar si o si antes que cualquier tag html....saludos

Si no le encontras la vuelta, proba postear esto en el foro de PHP.....

Saludos
Leo(!)
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:27.