🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #3217

Re: contar campos en mysql

#3217
From: RobertoCL
Date: Thu, 14 Apr 2005 03:07
45 lines
2197 bytes
Pero mysql_num_rows() es PHP, no se  vale ;-P
--
RCL
"Jos� Miguel Santib��ez" <jms@nospam.nivel5.cl> escribi� en el mensaje 
news:Xns9637E7DE0F82Ejmsnews@200.27.221.71...
> En el cap�tulo anterior (news:d3kkib$rb7$1@news1.nivel5.cl), "+mArkO+"
> <kitim@porta.com> dijo:
>
>> <?php
>>
>> $result = mysql_query("SELECT * FROM usuarios");
>> if (!$result) {
>>    echo 'Could not run query: ' . mysql_error();
>>    exit;
>> }
>> /* retorna la cantidad total de campos de la consulta*/
>> echo mysql_num_fields($result);
>> ?>
>>
>
> En ese caso, sugiero:
>> $result = mysql_query("SELECT * FROM usuarios LIMIT 0,1");
> Para ahorrar espacio...
>
> En todo caso, me parece m�s directo (la otra podr�a fallar si no hay
> registros)
>
> <?php
>
>  // conectar...
>
> $result = mysql_query("DESCRIBE usuarios");
> if (!$result) {
>    echo 'Could not run query: ' . mysql_error();
>    exit;
> }
> /* retorna la cantidad total de campos de la consulta*/
> echo mysql_num_rows($result);
> ?>
>
>
> -- 
>                           Jose M. Santiba�ez A.
>                             <jms@nivel5.cl>
>                           <http://caos.cl/jms> 
Technical Details
Message-ID: <d3kmsk$sj3$1@news1.nivel5.cl>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!nntp-server.pubsub.com!news1.nivel5.cl!not-for-mail
References: <d3kjl9$qv0$1@news1.nivel5.cl> <d3kkib$rb7$1@news1.nivel5.cl> <Xns9637E7DE0F82Ejmsnews@200.27.221.71>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,446a760b4d2d3ec7
X-Google-Attributes: gid1593cb,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!nntp-server.pubsub.com!news1.nivel5.cl!not-for-mail
From: "RobertoCL" <rcl@NOSPAMdmixnet.com>
Newsgroups: chile.comp.programacion
Subject: Re: contar campos en mysql
Date: Wed, 13 Apr 2005 23:07:03 -0400
Organization: Varios
Lines: 47
Message-ID: <d3kmsk$sj3$1@news1.nivel5.cl>
References: <d3kjl9$qv0$1@news1.nivel5.cl> <d3kkib$rb7$1@news1.nivel5.cl> <Xns9637E7DE0F82Ejmsnews@200.27.221.71>
NNTP-Posting-Host: pc-4-240-120-200.cm.vtr.net
X-Trace: news1.nivel5.cl 1113448148 29283 200.120.240.4 (14 Apr 2005 03:09:08 GMT)
X-Complaints-To: news@news1.nivel5.cl
NNTP-Posting-Date: Thu, 14 Apr 2005 03:09:08 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original