mugwumpr Posted May 22, 2009 Share Posted May 22, 2009 I've been trying to wrap my head around this one for awhile now, and it's got me totally stumped. I'm not even sure where to start.... I'm running a collector site with a database table for "eggs" and one for "users". I've got all the display, selecting, sorting, linking and whatnot down for the eggs, and I've got a perfectly useful registration form for the users. What I'm currently lacking is a way to connect the two to produce an editable and save-able checklist so that the user can maintain a list of eggs that they have/need. I have no idea how to set this up; not even if I need a new table (I suspect "yes"), or if it can be done with the existing ones through PHP. There are currently 221 eggs, and it's growing daily. As of this moment, there is 1 user - me. No point in others if they can't save their lists. I have a lovely checklist that does everything I want, EXCEPT save which little boxes have checkmarks in them, based on which user is logged in. Will someone please give me a little shove in the right direction? Point me to a tutorial maybe? A book? Even an example page that I can cannibalize or adapt? :-\ MySQL version 5.1.30, InnoDB Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/159288-checklist-for-collector-site/ Share on other sites More sharing options...
fenway Posted May 22, 2009 Share Posted May 22, 2009 Maybe you can explain this "list" in more detail? Quote Link to comment https://forums.phpfreaks.com/topic/159288-checklist-for-collector-site/#findComment-840190 Share on other sites More sharing options...
mugwumpr Posted May 22, 2009 Author Share Posted May 22, 2009 I can do better than that, I can show it to you: http://www.fordetectives.com/checklist.php I want to make the little checkboxes on the left (under "Own") active, so that a member can check them, save the sheet, then pull up that list to update it when they collect more. Currently people are just printing it and using it analog. Quote Link to comment https://forums.phpfreaks.com/topic/159288-checklist-for-collector-site/#findComment-840225 Share on other sites More sharing options...
kickstart Posted May 23, 2009 Share Posted May 23, 2009 Hi Could you post the table structure? It would probably be best to have a table of eggs and a table of owners, and then a 3rd table that lists eggs owned by a particular owner. However, assuming you have a table of eggs also containing the owner (so a particular type of egg could have multiple lines, one for each owner), a rough idea:- SELECT * FROM (SELECT DISTINCT eggName FROM eggs) AS a LEFT OUTER JOIN eggs b ON a.eggName = b.eggName AND b.eggOwner = $TheOwner LEFT OUTER JOIN eggOwners c ON b.eggOwner = c.Person However this is probably not a good idea as it means loads of duplicated info on the rows on the table for identical eggs owned by different people. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/159288-checklist-for-collector-site/#findComment-840616 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.