Search found 2 matches

by OldCannon
Sun Nov 07, 2010 11:10 pm
Forum: Technical Tips, Questions & Discussions (Computers & Internet)
Topic: Anyone know php + mysql? help needed
Replies: 9
Views: 2237

Re: Anyone know php + mysql? help needed

Russell wrote:Just fyi, if you are not opposed to using Microsoft for development, ASP.NET makes it ridiculous easy to do all this. Membership roles and Profiles are very easy to work with =)

I am actually busy completely recoding texas3006.com into .NET using C#. I'm going to be able to pull off some really nifty things that are a headache to do in PHP.
I wouldn't be too dismissive of PHP/SQL. While ASP.NET/C# are very powerful, the PHP community shines more as you scale upward into CMS stuff. Both sides have advantages and disadvantages. There's definitely things to do in ASP.NET that are a headache compared to PHP :-) ASP.NET 4.0 and the MVC2 library go a long way to addressing a lot of those concerns, but PHP isn't sitting still either.
by OldCannon
Sun Oct 31, 2010 6:23 pm
Forum: Technical Tips, Questions & Discussions (Computers & Internet)
Topic: Anyone know php + mysql? help needed
Replies: 9
Views: 2237

Re: Anyone know php + mysql? help needed

Well, I'll state the obvious and say it looks like you're reinventing the wheel -- these kind of features already exist in Drupal or PPHBB. However, I'll answer this assuming you're doing this as an academic exercise. If I understand your question, you want to show a form that has a list of groups (likely in the form of checkboxes?) and then turn on those groups that the user is subscribed to?

Since I'm neither a PHP expert nor a SQL expert (but I work with both :cool: ), I'll do some generalized hand-waving here:
1) A group of checkboxes with the same name are treated as an array
2) You would create a SQL query that gets the complete list of group names from the server, sorted in whatever order suits you
3) You would create a SQL query that get the complete list of user-subscribed group names from the server, sorted in the same order
4) For each item in the complete group list query, you would create a checkbox with the "value" being the actual group name. If the first user-subscribed group list matches, mark the checkbox "on" and advance the user-selected list (unless, of course, you're out of user-selected list items)

When you're done, you have a collection that is an array of checkboxes that have the user-selected checkboxes turned on.

Easy peasy.

You probably want to take questions that are more complex than that to a PHP forum :thumbs2:

Return to “Anyone know php + mysql? help needed”