I have a script which works great for saving users in comma seperated value to MySQL 'reserve' field.
eg '510,465,8552'
I then have the script below which echos the users name from the comma seperated 'reserve' field. The bit i am struggling with is to be able to click on a delete image next to one of the users and it will delete the users id from the comma seperated value.
$entries = get_records_sql ("SELECT * FROM development ORDER BY pdorder ASC");
foreach($entries as $lesson) {
$waiting = explode(",", $lesson->reserve);
foreach($waiting as $unlucky) {
$reserveuser = get_record("user", "id", $unlucky);
if($reserveuser->id>1){
echo '<li id="lstno'.$lesson->id.'" name="'.$reserveuser->id.'">'.$reserveuser->firstname.' '.$reserveuser->lastname.' ';
echo '<a href="removereserve.php?id='.$lesson->id.'&reserve='.$reserveuser->id.'"><img title="unenrol" src="delete.gif" /></a>';
echo '</li>';
}
}
Any guidance would be much appreciated, thanks in advance.