Sorry, I searched around and couldn't find anything to answer my specific question.
I am making this page for a pretend library, where people can check out books. They can check out any amount, they enter the amount, then enter the names.
So, I wanted to update a database, saying that the books were 'signed out'. This is where my question comes in.
Say a user takes out 3 books. I have three parameters in the url, book1, book2, book3, each containing the name of the book. I also have parameter called numBooks that tells how many books they want to take out
The code I tried looked something like this:
$num = $_GET['numBooks'];
for($i=1;$i<=$num;$i++) {
$book{$i} = $_GET["book{$i}"];
}
That didn't work. Is there a way to do it? If so, how?