1042 Posted September 14, 2006 Share Posted September 14, 2006 Hi all,i have a question and i was wondering if someone could get me on the right track, im building a site for members, i have the login part completed, within this site i have an events page also, on the admin part the user can add events for others to see, my events table is simple:IDTittleContentwhat i need to do is allow the members to register for an event, for instance if they are reading the events i want to display a link that would say "register for event" and they can just click and register since they are already logged in, my question is should i make another table to hold the users that register for a particular event? and then have the link (thru a php script like a newsletter system )add their user name to that event? also how would i tell the system what users are register for a particular event (how would i combine both tables the events table and the users table) , i hope i made sense, i thank anybody in advance for the help. Link to comment https://forums.phpfreaks.com/topic/20791-need-a-little-guidance/ Share on other sites More sharing options...
Caesar Posted September 15, 2006 Share Posted September 15, 2006 An oversimplification of how to go about it:[color=orange]events[/color] table[code]| eventid | desc | date |----------------------------------------------- 1 mudwrestling... 11158347[/code][color=orange]regevents[/color] table[code]| eventid | user_id | user_name |--------------------------------------------------- 1 27 durtibstrd[/code][code]<?php$query_event = $db->query("SELECT * FROM regevents WHERE user_id = '$userid'");$event = $db->fetch_array($query_event);$query_event2 = $db->query("SELECT * FROM events WHERE eventid = '$event[eventid]'");$eventinfo = $db->fetch_array($query_event2);?>[/code]Of course database design and approach will vary depending on your plans in the big picture. And of course there are many methods. Hope that helps. Link to comment https://forums.phpfreaks.com/topic/20791-need-a-little-guidance/#findComment-92093 Share on other sites More sharing options...
1042 Posted September 15, 2006 Author Share Posted September 15, 2006 I see, but how would both tables be combined when inserting data in to them? thanks for the help in advance. Link to comment https://forums.phpfreaks.com/topic/20791-need-a-little-guidance/#findComment-92662 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.