Hey Guys,
I need some assistance if possible. I am using MySQL & PHP, I have an "events" table with a row field called "Users_Attending" and can't seem to figure out the best way to add multiple users to an event rows "Users_Attending" field. I want to store user emails in the Users_Attending field like: user@test.com, user2@test.com, user3@test.com
I thought about using an array of some sort to store the user emails but not sure what I should do, any assistance would be greatly appreciated! Oh and the the function within my class that I am talking about is "add_to_list()" which is below, right now it works but it just replaces the old value stored in Users_Attending with the new value. Oh yeah and all I am storing in the $user = $_SESSION; is the current user's email address.
public function add_to_list(){
$condb = new DBCON();
$condb->startcon();
$date = date("Y-m-d");
$user = $_SESSION['User'];
$event = mysql_query("SELECT id FROM events WHERE Event_Date = '$date'");
$event_row = mysql_fetch_row($event);
$list_query = mysql_query("UPDATE events SET Users_Attending = '$user' WHERE id = '$event_row[0]'");
if($list_query){
//success
}
else{
//failed
}
}