Retroceder   Foros del Web > Programación para sitios web > Bases de Datos

Respuesta
 
Herramientas Desplegado
Antiguo 03-jun-2003, 10:24   #1 (permalink)
Rober1978 está en el buen camino
 
Fecha de Ingreso: noviembre-2002
Mensajes: 70
error mysql ayuda please

Hola amigos ,me han dicho anteriormente que para ayudarme tendia q poner el escipt aqui , pues me da el siguiente ERROR.El problema q tengo es q al registrarse los usuarios y enviar el formulario de registro de un error al primer intento de mysql.
Gracias de antemaqno

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

y este es el script.
(lo pongo por partes porque es demasiado extenso y no me deja)

<?

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>

<?

/*siguiente cacho de script*/

}

?>

</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">

<?

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>
__________________
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¡¡¡
Rober1978 está desconectado   Responder Citando
Antiguo 03-jun-2003, 10:41   #2 (permalink)
Cain ha deshabilitado el karma
 
Avatar de Cain
 
Fecha de Ingreso: noviembre-2002
Ubicación: Catalunya
Mensajes: 6.494
Enviar un mensaje por AIM a Cain Enviar un mensaje por Yahoo  a Cain
En cada uno de tus querys, pon [b]or die(mysql_error());

Así verás donde está el error.
__________________
http://malditofriki.com/
Cain está desconectado   Responder Citando
Antiguo 03-jun-2003, 16:36   #3 (permalink)
Rober1978 está en el buen camino
 
Fecha de Ingreso: noviembre-2002
Mensajes: 70
necesito saber cual es el error

Hola ,no entiendo nada casi de mysql, haber si alguien viebndo el código se enrolla y me dice cual es el error y la corrección, Gracias de antemano.
__________________
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¡¡¡
Rober1978 está desconectado   Responder Citando
Antiguo 04-jun-2003, 01:50   #4 (permalink)
Cain ha deshabilitado el karma
 
Avatar de Cain
 
Fecha de Ingreso: noviembre-2002
Ubicación: Catalunya
Mensajes: 6.494
Enviar un mensaje por AIM a Cain Enviar un mensaje por Yahoo  a Cain
Todas tus consultas siguen este patrón:

Código PHP:
<?
$query
"select * from educacion;";
$reducacion=mysql_query($query);
?>
Perfecto

Ahora sólo te queda buscar el error. Así:

Código PHP:
<?
$query
"select * from educacion;";
$reducacion=mysql_query($query) [b]or die ($query."<br>Produjo el error:<br>".mysql_error());
?>

Esto te permitirá ver qué error se está produciendo, y donde.
__________________
http://malditofriki.com/
Cain está desconectado   Responder Citando
Respuesta
No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 09:16.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93