On Thu, 2004-08-26 at 13:49, PHP Junkie wrote: > Ave, > > Jay.. > Firstly thanks a lot for the tips. I appreciate that and in fact I do try to > go methodically in most cases, even using the pen & paper to create my flow > charts and diagrams of what I'm about to program. I actually love that > method of designing an application. > > In fact, for this Phonebook application as well, right here in front of me > is the piece of paper in which I've tried to draw the different modules, > their behaviors and the functions which I will need to create in order to > make this application work intelligibly. > > Coming back again to my problem.. > If, in the table I'm storing my records, I create a field which stores the > Users allowed access to that particular record, then in case of multiple > users, that single field will hold multiple user names... Which is a problem > for me. And I might be applying a very wrong approach, logically, which is > why I came forward for some assistance. > > Thanks again. > > > > On 8/26/04 1:37 PM, "Jay Blanchard" <[EMAIL PROTECTED]> > wrote: > > > [snip] > > There is one feature that Admin gets which I'm trying to figure out. > > When the Admin is adding a record, he gets to decide which users he > > wants to > > share the record with. He can choose particular Users by clicking on > > their > > name to share that record with. How do I make that happen? > > > > Any suggestions? > > [/snip] > > > > I am going to go a little sideways in response to your question because > > I believe that we should help people to learn and improve. > > > > Many people enter the PHP arena and become exposed to the shear power > > available to them, so they want to accomplish more and more complex apps > > than they would in the course of normal web site interaction. > > > > I believe at this point one makes the leap from web developer to > > applications developer. > > > > One of the first things an applications developer should learn is how to > > design an application before they write the first line of code. This > > requires things like flowcharting and UML. Every programming language > > book has several words on this. > > > > So, Junkie, what you should do is break down the the componenets into > > statements. The statements can then be broken down some more...into > > processes, decisions, etc. Once done you will know what the code is. > > It's very zen. > > > > 1. Admin adds record. > > 2. Admin chooses user type(s) that will be allowed access to record. > > 3. Admin saves information so that application "knows". > > > > NAME ACCESS_LEVEL > > bhoover admin > > pnosehair user > > > > etc. > > > > [/off soapbox] > > > >
Very much to what Jay mentioned above, you have to take the time to design, although you may have the "logic" thought out, you need to look at the way you want to interact with the data and the problems it seems to be presenting to you. An app like you are writing is very straight forward IF you have the data structured properly. <aside> I used to give a project very similar to this to my students when I used to teach programming and logic and all of my students had the same problem</aside> I would advise you to read up on normalization particularly second and third normal forms and that should clear up your difficulties. Have a quick read of: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html to start. HTH -- Regards, David GetAnyIdeas Web Design [EMAIL PROTECTED] P. 416.452.9410 F. 416.570.4529 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php