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
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
Share on other sites

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.