Jump to content

Getting date and updating multiple tables.


Recommended Posts

As I am new to all this php, I need some help and/or ideas on how to code this little idea of mine:


I have a database with a members table, I would like to create some Teams, and so I want too create a new table with the info for these teams.


My problem is to set what team a member belongs too. My idea short


Add a new column in the members area to hold the Id of the team this member belongs too.


So if member 1000 sends a "join team link" too member 2000 the script needs to get the team id from member 1000 and add this id to member 2000.


select teamid from members where id=1000

update teamid='same id as member 1000' where id='membersid'


I hope this all makes sense, cause I am having a hard time trying to explain it.

Link to comment
Share on other sites

Hi mate,


I think i know what you mean.


If you send the link via email you could include the link in the body, something like:




$team_name would be taken from the users row in the database who is sending the link.


When the user clicks the link, jointeam.php would take $team_name from the url using the $_GET method and then you could use a mysql_query to write the team name to the new members row in the database.


Sorry i had to be brief im just on my way out. If nobody else helps you by the time i get back and its not too late i could write you up a quick example if you want.


Hope it helps.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

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

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.