Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/04/2008, 06:48
dbzsoft
 
Fecha de Ingreso: agosto-2007
Mensajes: 50
Antigüedad: 16 años, 9 meses
Puntos: 0
funciones no imprime error

hola tengo lo siguiente 1.php:

<?
include('../func_clientes.php')

//Mostramos los registros
$result =cliente('1');
while ($row=mysql_fetch_array($result))
{$a= $a+1;
imprimetabla();

}
mysql_free_result($result);
?>



y en func_clientes.php'

function cliente($valor){

switch ($valor){

case "1"://Cliente que más a Comprado
$query=mysql_query("select * from clientes where fecha_creacion >='$anio2' and fecha_creacion<='$anio3'");
break;

case "2"://Selecionar Clientes Por Año o por rango de meses
$query=mysql_query("select * from clientes, cotizaciones, ventas where ventas.id_cotizacion = cotizaciones.id_cotizacion and cotizaciones.id_cliente = clientes.id_cliente order by ventas.valor_cancelado asc limit 10");
break;

......

}
return $query;
}

function imprimetabla($valor){
switch ($valor){

case "1":
echo '<td>'.$row["id_cliente"].'</td>';
echo '<td>'.$row["apellidos"].'</td>';
echo '<td>'.$row["nombre"].'</td>';
echo '<td>'.$row["nom_entidad"].'</td>';
echo '<td>'.$row["celular"].'</td>';
echo '<td>'.$row["telefono"].'</td>';
echo '<td>'.$row["email"].'</td>';
echo '<td>'.$row["ciudad"].'</td>';
echo '<td>'.$row["fecha_creacion"].'</td></tr>';
break;

.....

}

return;
}

--------------------------------
Por que la función no me imprime nada.. cual seria la solucion ya que me sale el mensaje:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\crmanager\tablas\muestraclientes1.p hp on line 248

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\crmanager\tablas\muestraclientes1.p hp on line 262

y si coloco un query directo solo me imprime las filas y no los datos