CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Limit Count to 5

Print topic Send  topic

Author Message
Damian Hupfeld
Posted: 10/04/2004, 10:32 PM

I have a database where people can join a maximum of 5 "groups". I would
like to hide the "Add New" option once their user ID was associated with 5
(or more - which technically shouldnt happen) groups.

user
userid
name
login
pass
level

groups
groupid
userid
group

Basically I want to query table "groups" and do a count on the "userid"
field and return the number of times the Current Ligged In User is present.

I have a variable :$currentuser" which gets its value via a
CCGetSession(LoginID).

How do I code the a) query, and b) the show/hide on the Add New link.

regards
Damian

peterr


Posts: 5971
Posted: 10/05/2004, 2:07 AM

Possibly these would help:
http://forums.codecharge.com/posts.php?post_id=44958
http://forums.codecharge.com/posts.php?post_id=46702
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Damian Hupfeld
Posted: 10/05/2004, 9:07 PM

Thanks Peter(r),

Some good starting (or maybe ending) points there.Any suggestions on the SQL
query to check how many groups the user is already a member of?

regards
Damian

PS Sorry - I am using a news reader so I dont have access to the whole
archive as your NNTP server only gives a few days worth of posts. This means
thaty often my searches do not find info that is findable on the website.



"peterr" <peterr@forum.codecharge> wrote in message
news:54162644420724@news.codecharge.com...
> Possibly these would help:
> http://forums.codecharge.com/posts.php?post_id=44958
> http://forums.codecharge.com/posts.php?post_id=46702
> _________________
> Peter R.
> YesSoftware Support Representative
> http://support.codecharge.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

peterr


Posts: 5971
Posted: 10/06/2004, 2:03 AM

To provide correct answer I would need to implement and test this, but for now I can suggest that you use the CCDLookup as shown at http://docs.codecharge.com/studio/html/ProgrammingTechn...gleDBValue.html , and replace "user_name" with SQL count function, like "count(groupid)"
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.