Tema: Random
Ver Mensaje Individual
  #14 (permalink)  
Antiguo 19/11/2003, 08:28
josemi
Ex Colaborador
 
Fecha de Ingreso: junio-2002
Mensajes: 9.091
Antigüedad: 21 años, 10 meses
Puntos: 16
Mejor pon tu el trozo de codigo que usas actualmente, porque me extraña ese comportamiento.

Espera, he vuelto ha revisar el manual y pone
Cita:
If you are picking only one entry, array_rand() returns the key for a random entry. Otherwise, it returns an array of keys for the random entries. This is done so that you can pick random keys as well as values out of the array.
Es decir, que devuelve el indice del array. Y me parece que tue estas pasando a tu query el valor devuelto por array_rand(), cuando tendrias que estar pasando el valor del array para el indice devuelto por array_rand().

Suerte.
__________________
Josemi

Aprendiz de mucho, maestro de poco.