Jump to content


would this be the correct way to do this

  • Please log in to reply
2 replies to this topic

#1 aaronrb

  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts

Posted 23 April 2006 - 08:20 PM


i would liek to know if this is the correct way to work on my project before i spend loads of time working on it and it doesnt work.

i woudl like to create a huge list so that me and my friends can add the films that we own.

i would liek the first page to have a text box or a drop down menu so that they can select how many films they wanna add at any one time.

and then it will move on to the next page with that desired amount of textboxes.

now the way that i would image this was done, was to use a foeeach statement.
would i be right in saying this??

and also if this is the way, as i have never used this before how would i go about adding it to mysql db.

thanks in advance.

#2 shimano55

  • Members
  • Pip
  • Newbie
  • 8 posts
  • LocationLos Angeles, CA

Posted 23 April 2006 - 10:42 PM

Well a for statement would make more sense for this situation.

$numBoxs = $_POST['boxes'];
for ($i=1;$i<=$numBoxes;$i++) {
echo "<textarea name='box".$i."' rows=5 cols=50></textarea><br />";

This would make the number of text boxes and have them named box1,box2,box3,etc.

As for adding them to a mysql database, that depends on how your database is built.

PHP is my life.

#3 aaronrb

  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts

Posted 24 April 2006 - 10:20 AM

thanks for that, adding them to database,
i would liek tthe name of hte film, an autonumber which will be the film number, and the catergory of the film.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users