Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/11/2011, 13:32
jane985
 
Fecha de Ingreso: marzo-2011
Mensajes: 15
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: guardando consulta a fichero

muchas gracias jotaincubus por responder, realice los cambios que me comentaste de la siguiente manera :




$conexion = mysql_connect("localhost", "test", "test") or die ("Error: ". mysql_error());

mysql_select_db("test", $conexion);

$sq1="select products_id from products_to_categories where categories_id = '87' ORDER BY products_id DESC";

$result=mysql_query($sq1);

while($row=mysql_fetch_array($result)){
$variable=$row["products_id"];
$file = fopen("productos.txt","w+");
fwrite($file,"$variable");
}

Pero me sigue mostrando un solo dato y no el conjunto de products_id perteneciente a esa categories_id, no se si estoy haciendo algo mal , me podrias ayudar por favor?