Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > PHP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 01-02-2007
Avatar de enecumene
[enecumene] enecumene is offline
Miembro de Oro
 
Registrado: may 2006
Ubicación: Santo Domingo, Rep. Dom.
Posts: 3.040
Poder: 24
enecumene Va por buen camino
bueno ya yo resolvi:
Código PHP:
mysql_select_db("pedido"); 
$_pagi_sql ="select status, count(status) as count from reg_pedidos where fecha_rec_ped>= '$año-$mes-01' and fecha_rec_ped<= '$año-$mes-31' group by status order by status"
$_pagi_result=mysql_query($_pagi_sql); 
$num_resultados mysql_num_rows($_pagi_result); 
echo 
'<table width="691" border="0" cellpadding="0">'
echo 
'<tr bgcolor="#000000">'
echo 
'<th width="496" scope="col"><span class="style16">Status</span></th>'
echo 
'<th width="93" scope="col"><span class="style16">Total</span></th>'
echo 
'<th width="94" scope="col"><span class="style16">%</span></th>'
echo 
'</tr>'
echo 
'</table>'
while(
$row=mysql_fetch_array($_pagi_result)) 

echo 
'<table width="691" border="0" cellpadding="0">';  
echo 
'<tr>'
echo 
'<th width="496" scope="col"><span class="style15">'
echo 
stripslashes($row["status"]); 
echo 
'</span></th>'
echo 
'<th width="93" scope="col"><span class="style15">'
echo 
stripslashes($row["count"]); 
echo 
'</span></th>'
echo 
'<th width="94" scope="col"><span class="style15"></span></th>'
echo 
'</tr>'

echo 
'</table>'
la consulta la puse de esta manera:

Código SQL [-]
select status, count(status) as count from reg_pedidos where fecha_rec_ped>= '$año-$mes-01' and fecha_rec_ped<= '$año-$mes-31' group by status order by status

gracias a fdelamo por la ayuda prestada te lo agradezco.

Última edición por enecumene fecha: 01-02-2007 a las 23:38:12.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
valor de SELECT COUNT maruenda SQL 15 25-05-2007 22:58:38
Es posible consulta SQL con 'Count' y Valor de un campo ? gluglu SQL 11 09-01-2007 00:02:39
Problema con consulta not in (select ....) VRO Firebird e Interbase 12 03-10-2005 18:54:05
Problema conuna consulta select...not in (select ...) VRO Firebird e Interbase 2 11-08-2005 08:56:35
Select Count (distinct X) lunatiko SQL 2 17-10-2004 21:06:45


La franja horaria es GMT +2. Ahora son las 18:37:05.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi