xwishmasterx Posted April 2, 2011 Share Posted April 2, 2011 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 https://forums.phpfreaks.com/topic/232503-getting-date-and-updating-multiple-tables/ Share on other sites More sharing options...
perky416 Posted April 2, 2011 Share Posted April 2, 2011 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: http://yoursite.com/jointeam.php?team=$team_name $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 https://forums.phpfreaks.com/topic/232503-getting-date-and-updating-multiple-tables/#findComment-1195985 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.