Part of my admin features is to give users access to certain pages. I've used the code at http://javascript.internet.com/forms...swapper-2.html to move users from one list to another but don't know how to save all the values added to the second list into mySQL DB. Can anyone help?
What exactly do you need help with? Do you have your database and tables setup, or do you need help with that? Or do you just need help building the SQL query?
Attached is an example of what i'm trying to do. I'm trying to get all the values in the right hand side list then loop through them and save each entry into my database.
Since I don't know how you have your database setup and how you're storing things in the table, I can't help you build the SQL query, but to loop the selected items, you'd do something like this:
PHP Code:
<html>
<head>
<title></title>
</head>
<body>
<?php
if (isset($_POST['submit'])) {
// Loop each selected item:
for ($i = 0; $i < count($_POST['items']); $i++) {
// Output the selected item:
echo $_POST['items'][$i] . '<br />';
}
} else {
?>