Jump to content

Need a little guidance


1042

Recommended Posts

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:

ID
Tittle
Content

what 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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.