Ver Mensaje Individual
  #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
Reputación: 22
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