Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/03/2003, 12:16
skamarcos
 
Fecha de Ingreso: febrero-2003
Mensajes: 12
Antigüedad: 21 años, 2 meses
Puntos: 0
Hola

mirando en php.net, en uno de los cometnarios que se hacen encontré este resumen:

Cita:
The mysql_fetch_row function returns an array with numeric indices.

For example, a row from the query:

SELECT bookid,title,author FROM books

would look like:

$record[0]=3
$record[1]="A Farewell To Arms"
$record[2]="Ernest Hemingway"

The mysql_fetch_assoc function returns an array with indices that are the field names, like such:

$record["bookid"]=3
$record["title"]="A Farewell To Arms"
$record["author"]="Ernest Hemingway"

The mysql_fetch_array function returns an array with both kinds of indices, so this array looks like:

$record[0]=3
$record["bookid"]=3
$record[1]="A Farewell To Arms"
$record["title"]="A Farewell To Arms"
$record[2]="Ernest Hemingway"
$record["author"]="Ernest Hemingway"

This is the reason for the "doubled" field output from the example.

Note that the mysql_fetch_array function has an optional parameter where you can specify the indices.

So replacing the call:

mysql_fetch_array($result)

with:

mysql_fetch_array($result,MYSQL_NUM)

would be an identical fix to:

mysql_fetch_row($result)

Hope this helps!
Espero que sirva a alguien, a mi mas o menos me ayudo a entender lo que hacía al poner mysql_fetch_xxx

Un saludo