Re: problemas con el mysql_fetch_array()
| From: | Adrian | Date: | Tue, 27 Apr 2004 12:18:49 +0000 |
| Subject: | Re: problemas con el mysql_fetch_array() | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-48011@lists.php.net to get a copy of this message | ||
$sql="SELECT * FROM institucion WHERE nombre='$nombreInstitucion'";
te faltaron las comillas de $nombreInstitucion
Saludos
Adrian
----- Original Message -----
From: "Diana Montes" <pilimontes@hotmail.com>
To: <php-es@lists.php.net>
Sent: Monday, April 05, 2004 12:11 AM
Subject: [PHP-ES] problemas con el mysql_fetch_array()
>
> Hola! lo que pasa es que estoy trabajando en php y tengo problemas
> cuando hago una consulta porque sale el siguiente mensaje:
>
>
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
> result resource in c:\archivos de programa\apache
> group\apache\htdocs\sycosoft\applications\sycosoft\data\Mysql\Mysqlin
> stitucion.class.php on line 125
>
> el codigo donde esta el error es el siguiente:
>
> function getIdInstitucionPorNombre($nombreInstitucion)
> {
> $sql="SELECT * FROM institucion WHERE nombre=$nombreInstitucion";
> $this->consult = mysql_query($sql, $this->connection);
> return $this->toArray($this->consult);
> }
> function toArray($handle)
> {
> $vector=null;
> for($i=0;$row = mysql_fetch_array($handle);$i++){
> for ($j = 0; $j < mysql_num_fields($handle); $j++){
> $vector[$i][mysql_field_name($handle, $j)] = $row[$j];
> }
> }
> return($vector);
> }
>
> Gracias!!
>
> --
> PHP Spanish Localization Talk Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>