Jason Charette
|
| Posted: 07/10/2001, 10:55 AM |
|
Using CC1.2, PHP w/forms.
In either a grid or record, how can I get the number of rows returned from a
custom SQL query? I don't want to return the results themselves (well, maybe
later :), but just the numbers of rows. Is there a pre-defined variable for
this?
--
Jason Charette
Senior Web Developer
CADLink Technology Corporation
Email:jasonc@cadlink.com
Website: http://www.cadlink.com
|
|
|
 |
Michael A. Weaver
|
| Posted: 07/10/2001, 2:38 PM |
|
What type of SQL? MySQL?
I think CC 2 takes care of this (I see a Count SQL field, but I've yet to
explore...), so I'm not sure. Here's how I would do it. Go to Form
Properties > SQL > Use SQL String.
Type: SELECT COUNT(*) FROM your_table_name
(you can also replace the * with your id column name or whatever) Click OK.
Now go to Fields > File Properties > Common. Change the name of the field,
so there's no * or other special characters in it. For MySQL you should be
good to go.
michael
"Jason Charette" <jasonc@cadlink.com> wrote in message
news:9iffi0$ugn$1@news.codecharge.com...
> Using CC1.2, PHP w/forms.
>
> In either a grid or record, how can I get the number of rows returned from
a
> custom SQL query? I don't want to return the results themselves (well,
maybe
> later :), but just the numbers of rows. Is there a pre-defined variable
for
> this?
>
> --
> Jason Charette
> Senior Web Developer
> CADLink Technology Corporation
> Email:jasonc@cadlink.com
> Website: http://www.cadlink.com
>
>
|
|
|
 |
Alexey Alexapolsky
|
| Posted: 07/11/2001, 5:13 AM |
|
I consider it a good practise to
use : select count(*) AS TOTAL from table ,
and select "total" from the field list on form
--
Alex
CC Support
Michael A. Weaver <michael@tminuszero.com> wrote in message
news:9ifskt$pgj$1@news.codecharge.com...
> What type of SQL? MySQL?
>
> I think CC 2 takes care of this (I see a Count SQL field, but I've yet to
> explore...), so I'm not sure. Here's how I would do it. Go to Form
> Properties > SQL > Use SQL String.
>
> Type: SELECT COUNT(*) FROM your_table_name
>
> (you can also replace the * with your id column name or whatever) Click
OK.
>
> Now go to Fields > File Properties > Common. Change the name of the field,
> so there's no * or other special characters in it. For MySQL you should be
> good to go.
>
> michael
>
> "Jason Charette" <jasonc@cadlink.com> wrote in message
>news:9iffi0$ugn$1@news.codecharge.com...
> > Using CC1.2, PHP w/forms.
> >
> > In either a grid or record, how can I get the number of rows returned
from
> a
> > custom SQL query? I don't want to return the results themselves (well,
> maybe
> > later :), but just the numbers of rows. Is there a pre-defined variable
> for
> > this?
> >
> > --
> > Jason Charette
> > Senior Web Developer
> > CADLink Technology Corporation
> > Email:jasonc@cadlink.com
> > Website: http://www.cadlink.com
> >
> >
>
>
|
|
|
 |
Jason Charette
|
| Posted: 07/11/2001, 6:20 AM |
|
Thanks Alex. It's exactly what I did (about five minutes after the post -
inspiration, and co-workers sure do help! :)
"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:9ihftm$qce$1@news.codecharge.com...
> I consider it a good practise to
> use : select count(*) AS TOTAL from table ,
> and select "total" from the field list on form
>
> --
> Alex
> CC Support
>
>
> Michael A. Weaver <michael@tminuszero.com> wrote in message
>news:9ifskt$pgj$1@news.codecharge.com...
> > What type of SQL? MySQL?
> >
> > I think CC 2 takes care of this (I see a Count SQL field, but I've yet
to
> > explore...), so I'm not sure. Here's how I would do it. Go to Form
> > Properties > SQL > Use SQL String.
> >
> > Type: SELECT COUNT(*) FROM your_table_name
> >
> > (you can also replace the * with your id column name or whatever) Click
> OK.
> >
> > Now go to Fields > File Properties > Common. Change the name of the
field,
> > so there's no * or other special characters in it. For MySQL you should
be
> > good to go.
> >
> > michael
> >
> > "Jason Charette" <jasonc@cadlink.com> wrote in message
> >news:9iffi0$ugn$1@news.codecharge.com...
> > > Using CC1.2, PHP w/forms.
> > >
> > > In either a grid or record, how can I get the number of rows returned
> from
> > a
> > > custom SQL query? I don't want to return the results themselves (well,
> > maybe
> > > later :), but just the numbers of rows. Is there a pre-defined
variable
> > for
> > > this?
> > >
> > > --
> > > Jason Charette
> > > Senior Web Developer
> > > CADLink Technology Corporation
> > > Email:jasonc@cadlink.com
> > > Website: http://www.cadlink.com
> > >
> > >
> >
> >
>
>
|
|
|
 |
|