problemas con el mysql_fetch_array()
| From: | Diana Montes | Date: | Mon, 05 Apr 2004 04:11:15 +0000 |
| Subject: | problemas con el mysql_fetch_array() | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-48006@lists.php.net to get a copy of this message | ||
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!!