Jump to content

Recommended Posts

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!

 

 

Link to comment
https://forums.phpfreaks.com/topic/159288-checklist-for-collector-site/
Share on other sites

I can do better than that, I can show it to you: http://www.fordetectives.com/checklist.php

 

;D

 

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.

 

 

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.