First, how to access the form inputs: easiest way would likely be foreach( $_POST['myInputs'] as $myInput ){ … .
Next, how to get the array into the database: don't. There's no such thing as an array in an SQL database. The best solution is to use another table for the items in the array, with a foreign key to associate them with table (and rows) they belong to. I don't know the specifics of your DB structure or the data you need to store, but here's the general idea:
Code:
CREATE TABLE `user`(
`id` SERIAL PRIMARY KEY,
-- (other user fields)
)ENGINE=InnoDB;
CREATE TABLE `userURL`(
`url` VARCHAR (100) NOT NULL,
`user` SERIAL,
PRIMARY KEY (`user`,`url`),
FOREIGN KEY (`user`) REFERENCES `user` (`id`)
)ENGINE=InnoDB;
In this way, your array can be represented as SELECT url FROM userURL WHERE user=:desiredUserID.
If you need more help, please give more information.
Bookmarks