Foros del Web » Programando para Internet » PHP »

Warning: mysql_fetch_array()

Estas en el tema de Warning: mysql_fetch_array() en el foro de PHP en Foros del Web. hola quetal alguin me puede ayudar a corregir este error warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\prueba\proyecto2\alumno_modificar.p hp on ...
  #1 (permalink)  
Antiguo 22/03/2011, 16:46
 
Fecha de Ingreso: marzo-2011
Mensajes: 1
Antigüedad: 13 años
Puntos: 0
Warning: mysql_fetch_array()

hola quetal alguin me puede ayudar a corregir este error

warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\prueba\proyecto2\alumno_modificar.p hp on line 15

lo que quiero hacer es que me muestre los registros consultados en las cajas de texto pero me sale ese warning

les dejo el codigo

Código:
 <?
include("conexion.php");
	$rst_categorias=mysql_query("SELECT * FROM carreras;",$conexion);
	
	if (mysql_num_rows($rst_categorias)==0)
	{
		mysql_close($conexion);
		echo mostrar_mensaje("Debe agregar categorias","No hay categorias. Clic para registrarlas","");
		exit();
	}

//mostrar datos del registro seleccionado

$rst_alumnos=mysql_query("SELETC * FROM usuarios WHERE nombre=".$_REQUEST["idn"].";",$conexion);
$fila_alumno=mysql_fetch_array($rst_alumnos);
?>
<!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>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
.Estilo1 {color: #0000FF}
-->
</style>
</head>

<center> 
<table width="800" border="0">
  <tr>
    <td height="18"><div align="center" class="title" >Modificar registro </div></td>
  </tr>
  <tr>
    <td><div align="center" class="Estilo1"></div>
        <div align="center" class="Estilo1"><a href="javascript:history.go(-1)">Regresar al listado de productos</a></div></td>
  </tr>
  <tr>
    <td class="style6"><form name="productos" action="alumnew_guardar.php" title="Nuevo Producto" style="border:thin" method="post">
	<table style="width: 100%">
		<tr>
			<td style="width: 200px" class="style5">Id<span class="style8">*</span></td>
			<td class="style7">
			<input name="codigo" type="text" class="style10" style="width: 65px" value="<?php echo $fila_alumno["id"]?>"></td>
		</tr>
		<tr>
			<td style="width: 200px" class="style5">Nombre<span class="style8">*</span></td>
			<td class="style7"><input name="nombre" type="text" style="width: 331px" class="style10" /></td>
		</tr>
		<tr>
			<td style="width: 200px" class="style5">Apellidos<span class="style8">*</span></td>
			<td class="style7"><input name="apellidos" type="text" class="style10" id="apellidos"></td>
		</tr>
		<tr>
			<td style="width: 200px" class="style5">Calificaciones<span class="style8">*</span></td>
			<td class="style7"><input name="calificaciones" type="text" class="style10" id="calificaciones"></td>
		</tr>
		<tr>
			<td style="width: 200px" class="style5">&nbsp;</td>
			<td class="style7">&nbsp;</td>
		</tr>
		<tr>
          <td style="width: 200px" class="style5">&nbsp;</td>
		  <td class="style7">&nbsp;</td>
		  </tr>
		<tr>
			<td style="width: 200px" class="style5">Carreras<span class="style8">*</span></td>
			<td class="style7">
            <select name="carreras" class="style10" id="carreras">
			<option selected="" value="">[Seleccione una categor&iacute;a]</option>
            <?php
				while ($fila=mysql_fetch_array($rst_categorias))
				{
					echo "<option value='". $fila["idcarreras"]."'>".$fila["nomcarreras"] ."</option>";
				
				}
			?>
			</select></td>
		</tr>
		<tr>
			<td style="width: 200px" class="style5">&nbsp;</td>
			<td class="style7">&nbsp;</td>
		</tr>
		<tr>
			<td style="width: 200px" class="style5">&nbsp;</td>
			<td class="style11">
			* <span class="style12">Los campos son requeridos.</span></td>
		</tr>
	</table>
	*<input name="Submit1" type="submit" value="Guardar"></form>
	</td>
  </tr>
</table>
</center>
</body>
</html>
  #2 (permalink)  
Antiguo 22/03/2011, 16:52
Avatar de eits  
Fecha de Ingreso: junio-2005
Ubicación: valladolid, yucatán
Mensajes: 1.655
Antigüedad: 18 años, 9 meses
Puntos: 88
Respuesta: Warning: mysql_fetch_array()

intenta asi
Código PHP:
Ver original
  1. $rst_alumnos=mysql_query('SELETC * FROM usuarios WHERE nombre="'.$_REQUEST["idn"].'"',$conexion);
  2. $fila_alumno=mysql_fetch_array($rst_alumnos);
saludos.
__________________
El amor es la locura mas lucida que tiene el hombre.- Andres Henestrosa
la tristeza no existe, solo es... la ausencia de la felicidad.

Etiquetas: warning
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:28.